Leipzig had gone six points clear at the summit on Friday with a 4-1 win at Freiburg, and Bayern were grateful to Hummels for heading home
Mats Hummels headed the winner as Bayern Munich beat Bayer Leverkusen 2-1 on Saturday to end a three-game winless streak and trim RB Leipzig's Bundesliga lead to three points.
Leipzig had gone six points clear at the summit on Friday with a 4-1 win at Freiburg, and Bayern were grateful to Hummels for heading home a Joshua Kimmich corner in the second half as they got the better of Leverkusen at the Allianz Arena to cut the deficit.
Thiago Alcantara had given Carlo Ancelotti's Bayern a first-half lead only for Hakan Calhanoglu to make it 1-1 at the break before Hummels struck.
In the second half, Leverkusen's Kevin Kampl and Kevin Volland both went close with late chances to equalise.
The result returns second-placed Bayern to winning ways following a 1-1 draw with Hoffenheim, a 1-0 defeat at Borussia Dortmund and Wednesday's 3-2 Champions League loss at Rostov.
"It was an important win, we needed a reaction and I think we are improving," said Ancelotti.
"Every team wants to be at the top, what matters is at the end of the season, but congratulations to RB Leipzig, they are having a great season."
The win boosted Bayern, who re-elected Uli Hoeness as club president on Friday despite the 64-year-old having only finished a 21-month jail sentence for tax evasion in February.
Before kick-off against Leverkusen, Hoeness apologised for having declared on Friday that RB Leipzig had joined Borussia Dortmund as being categorised as an "enemy" of Bayern.
"In football -- there are rivals and opponents," Hoeness told Sky.
"I'd officially like to take the word 'enemy' back and I apologise for it."
Earlier, Dortmund were brought crashing to earth following a record Champions League win in midweek with a 2-1 defeat at Eintracht Frankfurt, who went third.
It was a first defeat in 10 games for Dortmund and followed their 8-4 romp on Tuesday at home to Legia Warsaw -- a record score for a Champions League game.
Hungary international Szabolcs Huszti gave the home side the lead only for Pierre-Emerick Aubameyang to equalise, before Haris Seferovic grabbed the winner for Frankfurt, who are unbeaten in six league games.
Dortmund coach Thomas Tuchel made eight changes to the team which started against Legia.
His side was again guilty of poor defending as Frankfurt scored both their goals from restarts.
"Technically, tactically, mentally and in our willingness we weren't up to it," fumed Tuchel.
After a goalless first half, Eintracht took the lead just 16 seconds after the break as Huszti converted a Timothy Chandler cross from close range.
Tuchel responded by making three changes with just over half an hour to go, bringing on Marco Reus, Ousmane Dembele and Sebastian Rode.
The move initially paid off as Aubameyang headed home Dembele's ball on 77 minutes, but from the restart, Seferovic slotted home Frankfurt's winner before Dembele hit the crossbar in added time for Borussia.
The result saw Frankfurt replace Dortmund in third and broke Borussia's run of four straight wins.
After their Champions League draw at home to Manchester City, Borussia Moenchengladbach were held to another 1-1 stalemate at Borussia Park, against Hoffenheim, to leave them winless in seven league games.
Gladbach took the lead when Syrian-born Mahmoud Dahoud belted his shot into the far corner on 25 minutes, but Nadiem Amiri equalised on 53 minutes to preserve Hoffenheim's unbeaten record this season.
Wolfsburg are just two points above the relegation spots after their 1-1 draw with Ingolstadt as Anthony Jung's goal was cancelled out by Wolfsburg's Daniel Caligiuri.
Wolfsburg goalkeeper Diego Benaglio saved a first-half penalty by Moritz Hartmann.
In a thrilling north German derby, bottom club Hamburg drew 2-2 at home to neighbours Werder Bremen.
Austrian international Michael Gregoritsch scored both of Hamburg's goals either side of a Fin Bartels strike before Bremen's Serge Gnabry made it 2-2 at the break.
In the afternoon's other game Cologne, who are fourth, were held to a 0-0 draw at home by Augsburg.