Julian Nagelsmann won his 100th Bundesliga game as Jamal Musiala's strike completed a 2-1 comeback victory over Mainz.
Perhaps suffering a hangover from their Champions League win over Barcelona, Bayern – without a number of key players – were far from their slick best on Saturday.
But the champions ultimately had too much quality, with Musiala, playing in an unfamiliar central midfield role, slotting in a 74th-minute winner.
Kingsley Coman had equalized to cancel out Karim Onisiwo's header, with Mainz unable to withstand the pressure as Nagelsmann moved onto a century of league wins in his 199th top-flight game as a coach.
More often a provider, Alphonso Davies had two chances to put Bayern ahead inside 10 minutes, but he failed to put a close-range volley on target before a deflected effort hit the post.
Yet Bayern's ominous start failed to produce a goal. Indeed, Mainz were unfortunate not to have a penalty when Dayot Upamecano barged into Jae-Sung Lee.
Bayern avoided punishment, but Mainz kept up the pressure and had the lead in the 22nd minute – Onisiwo heading in from Jonathan Burkardt's cross.
Thomas Muller saw an acrobatic attempt deflected over before Alexander Hack kept Coman at bay. It was the latter who got Bayern level in the 53rd minute.
Corentin Tolisso's well-weighted pass caught Mainz napping, with Coman's excellent touch setting him up for a strike that squirmed under Robert Zentner.
Coman latched onto another fantastic pass from deep soon after, this time cutting in from the left before drilling an effort just over.
Bayern's winner came with 17 minutes remaining, though, with teenager Musiala taking a sublime touch to create space on the edge of the box before finding the bottom-left corner with unerring accuracy.