Borussia Dortmund's 6-1 hammering of Stuttgart on Friday night sent Jurgen Klopp's men to the summit and it looked like they would end the weekend there when Niklas Sule became Hoffenheim's youngest ever goalscorer to shock Bayern in the 34th minute.
But the German and European champions hit back five minutes later when Franck Ribery's free-kick deflected in off team-mate Mario Mandzukic before Thomas Muller then snatched victory for the Bavarians with 15 minutes to go.
The strike restored Bayern's one-point lead at the top of the league.
Third-placed Bayer Leverkusen slipped four points off the pace as they fell to a surprise 1-0 defeat at rock-bottom Eintracht Braunschweig, who claimed their first win of the season.
Domi Kumbela scored the only goal of the game nine minutes from time with nine minutes remaining as Braunschweig gave their crowd something to celebrate for the first time since returning to the top flight in the summer.
Leverkusen, who started out with a weakened side, suffered even more misery at the death when Lars Bender was shown a red card.
Borussia Monchengladbach narrowed the gap with a 2-0 win at Hamburg, their first away triumph of the season.
Germany international Max Kruse struck in the 23rd and 63rd minutes to move to within six points of Leverkusen.
Maximilian Arnold's third goal in as many games lifted Wolfsburg to fifth following a 2-1 win at Eintracht Frankfurt.
A Bamba Anderson own goal after only two minutes helped the Wolves on their way to victory and although Alexander Meier levelled before the break, Arnold then clinched victory for the visitors eight minutes from time.
Adam Szalai and Julian Draxler struck to earn Schalke all three points at Hertha Berlin on Saturday and give Jens Keller's men a confidence boost ahead of their trip to Chelsea in midweek.
The Hungarian headed home in the first half before Draxler scored with the last kick of the game to earn the Royal Blues a 2-0 win which lifts them up to sixth in the Bundesliga table.
Felix Klaus, Vladimir Darida and Admir Mehmedi were all-on target as Freiburg, who played the last 20 minutes with 10 men after Oliver Sorg was sent off, earned their first win of the season with a 3-0 defeat of Nurnberg.