A goal from Markus Rosenberg in the 80th minute won it for Thomas Schaaf's side, who beat Schalke to second spot and a place in the group stages of the Champions League next season.
Defeat, combined with results elsewhere, condemned Bayer to a seventh-place finish in the Bundesliga, which rules them out of even a place in the Intertoto Cup, and left their fans calling for the head of coach Michael Skibbe.
Schalke sealed Nurnberg's relegation from the Bundesliga but were unable to secure second place despite their 2-0 victory. Marcelo Bordon struck twice (19 and 60) as the Royal Blues collected their fifth victory in six games to finish in third place and secure the final qualification spot for the Champions League.
Bayern Munich collected the Bundesliga title in style after an emphatic 4-1 win over Hertha Berlin. A hat-trick from Luca Toni and a strike from Franck Ribery completed the rout for the German champions.
Valeri Domovchiyski scored an 84th-minute consolation goal for Hertha before Bayern coach Ottmar Hitzfeld and goalkeeper Oliver Kahn said emotional farewells following their last game for the club.
Elsewhere, Hamburg clinched a place in the UEFA Cup with a 7-0 hammering of Karlsruhe, while Wolfsburg beat Borussia Dortmund 4-2 to secure the final spot.
Arminia Bielefeld snatched a late 2-2 draw at Stuttgart to finish three points above the drop zone while the hosts missed out on a UEFA Cup berth.
Duisburg finished bottom of the table after losing 4-2 at Eintracht Frankfurt but already-relegated Hansa Rostock finished on a high by winning 2-1 at Bochum.
Hannover completed their campaign with a comprehensive 4-0 home victory over Energie Cottbus.