Bayern Munich defender Daniel van Buyten scored two minutes from time to give his team a 2-1 win over visitors Eintracht Frankfurt on Saturday and lift them to fifth place in the standings.
The hosts dominated throughout, missing a dozen clear chances, but it was Frankfurt who took the lead in the 60th minute when Alexander Meier pounced on a through ball from Patrick Ochs to slot home.
Dutch winger Arjen Robben levelled nine minutes later when he tapped in from close range following a header from fellow substitute Mario Gomez, before Van Buyten headed in at the far post in the 88th to seal the win which lifted Bayern to fifth place on 18 points.
Leaders Bayer Leverkusen, on 22 points, drew 1-1 against Borussia Dortmund on Friday and second-placed Hamburg SV, on 21 points, visit Schalke 04, who are third with 19 points, on Sunday.
"We created many chances against an opponent who was very defensive. But we just could not score," said Bayern coach Louis van Gaal.
"Then I brought on Robben and Gomez and put Van Buyten up front instead of (Luca) Toni. I was very lucky with my substitutions. I am satisfied."
Bayern were eager to make amends for their disappointing midweek Champions League defeat by Bordeaux and came storming forward, even without injured playmaker Franck Ribery.
Striker Miroslav Klose fired just wide in the sixth minute and in the 20th it was Italian Toni's turn to head wide from point blank range.
The hosts were again unlucky in the 43rd when Toni, battling to win back his starting spot after an injury break, shot on the turn but hit the post.
In an even more one-sided second half, Bayern desperately poured forward but the Allianz Arena was silenced in the 60th when Meier chased down an Ochs pass, shaking off defender Danijel Pranjic, to slot home.
Van Gaal immediately brought on Robben, just back from injury, and Gomez. The two combined well nine minutes later with Robben tapping in from close range.
In the dying minutes Van Buyten switched to an attacking role when Van Gaal brought on Argentine defender Martin Demichelis and the move paid off when the tall Belgian defender rose to head in a cross from Philipp Lahm.
Hoffenheim fired three goals past hapless Nuremberg to move into sixth place but troubled VfB Stuttgart sank deeper into trouble when they were beaten 1-0 by Hanover 96 courtesy of Ivorian Didier Ya Konan.
Stuttgart, one of the pre-season favourites, are in 14th place with only eight points. (Writing by Karolos Grohmann; Editing by Sonia Oxley; To comment on this story: