The Bavarians are within touching distance of their eighth consecutive league crown and have also set a league record with 90 goals after 30 matchdays.
Leverkusen’s 17-year-old Florian Wirtz stole some of the spotlight at the end, becoming the youngest Bundesliga scorer when he netted in the 89th minute.
Lucas Alario fired the hosts into the lead after 10 minutes as Leverkusen, without the injured Kai Havertz, scored with the first chance of the game.
But Bayern recovered from the early shock and Kingsley Coman curled in the equaliser in the 28th minute before the visitors struck twice in three minutes to turn the game around.
Leon Goretzka completed a sensational passing move in the 42nd minute and Serge Gnabry chipped the ball over keeper Lukas Hradecky on the stroke of halftime.
Bundesliga top scorer Robert Lewandowski headed in Thomas Mueller’s 20th assist of the season.
Lewandowski took his tally to 30 league goals but is still 10 shy of the all-time league record of 40 set by Gerd Mueller in 1971-72. Both he and Mueller were booked and will have to sit out their next game against Borussia Moenchengladbach.
“We needed a bit of time to get into the game and the goal was a wake-up call for us,” Bayern coach Hansi Flick, whose team has won 23 of the 26 matches since he took over earlier this season. “The way we came back from a goal down shows the attitude and mentality of the team.”
It was Bayern’s ninth straight win but there was also some cheer for Leverkusen despite their setback in the race for a Champions League spot.
German youth international Wirtz made a name for himself with a superb 89th-minute strike past keeper Manuel Neuer and made him the youngest Bundesliga scorer at 17 years and 34 days.
Borussia Dortmund’s 1-0 win over Hertha Berlin later means Bayern lead the table from Dortmund by seven points.
RB Leipzig are third, 11 points behind, after conceding a last-gasp equaliser in their 1-1 draw with bottom club Paderborn. Bayer Leverkusen stayed fifth.