Vedad Ibisevic put the hosts ahead within the first few seconds, but Thomas Mueller equalised before Daniel van Buyten struck a late, late winner for the visitors.
Within 37 seconds, Sebastian Rudy took took the ball off Diego Contento before squaring for Ibisevic, who tucked his shot comfortably into the net. Bayern struggled to create chances, but eventually equalized on 63 minutes, as Mueller followed up Franck Ribery's parried shot with a fine finish. Bayern pressed on, and were rewarded in injury time when Daniel van Buyten intercepted a header and poked home the game winner.
After Ibisevic's opener, Hoffenheim withdrew into a deep defensive stance, and stifled the slick-passing visitors, who did very little with close to 80% possession. Toni Kroos was clear on goal following a fortunate deflection, but he passed to the offside Miroslav Klose, and the chance went begging. Later, Bastian Schweinsteiger had a free header from eight yards, but failed to hit the target. Otherwise, clear chances for either side were almost non-existent.
At the half, Bayern coach Louis van Gaal replaced Contento and Kroos with Croatian pair Ivica Olic and Danijel Pranjic, who injected life into the visitors' attack. They pushed and pushed, and finally leveled through Mueller, though the moment had a bittersweet taste as Ribery turned his ankle as he shot on goal. The Frenchman was promptly replaced by Hamit Altintop.
Hoffenheim were visibly fatigued towards the end of the game, and appeared content to play for a draw, but Bayern had other plans in mind. Klose missed a clear chance on goal before Van Buyten's late winner.
The result leaves Bayern in seventh place, with eight points from five matches. Hoffenheim remain second, but have now fallen five points behind leaders Mainz.
For all the German news you can handle, check out Goal.com's Germany homepage and join Goal.com USA's Facebook fan page!