Bayern Munich returned to the top of the table as Arjen Robben scored one and set up another against Mainz on his 150th appearance in the Bundesliga.
Jhon Cordoba shot past Manuel Neuer to give the hosts a surprise early lead before Robert Lewandowski equalised after being set up by Robben.
Robben headed home from Thomas Muller’s cross to give Bayern the lead before a Lewandowski free-kick made it 3-1.
Bayern move above RB Leipzig on goal difference.
Both teams are on 30 points, but Bayern have played one game more.
Leipzig will re-establish a three-point lead if they beat eighth-placed Schalke at home on Saturday (17:30 GMT).
Champions Bayern had 10 shots in the opening 45 minutes against Mainz, and scored with two of their four attempts on goal.
Muller wasted a great chance to net his first Bundesliga goal of the season when the score was 1-1.
The 2014 World Cup winner has now gone more than 15 hours without a league goal.