Ibisevic put hosts ahead within the first few seconds...
The defending champions, who had been held scoreless for three consecutive matches, were within a quarter hour of setting a team record for minutes without a Bundesliga goal before Thomas Mueller equalised on 63 minutes. Deep into injury time, Daniel van Buyten struck to give the visitors a deserved three points.
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 equalised 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 levelled 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.