German champions Bayern looked back to their best after a poor run by their high standards.
It puts the onus back on surprise-package RB Leipzig, who drop to second on goal difference but can reclaim top spot on Saturday with a draw or victory at home to mid-table Schalke.
German champions Bayern looked back to their best after a poor run by their high standards that saw them lose at Borussia Dortmund and then Russia's Rostov in the Champions League.
They got back on track by beating Bayer Leverkusen 2-1 last weekend and were good value for the three points at Mainz, who stunned the Bavarians last season on Bayern's way to the Bundesliga title.
Friday's game was preceded by a minute's silence for the victims of this week's plane crash in Colombia that wiped out the Brazilian team Chapecoense.
The visitors were caught cold however after just four minutes when Jhon Cordoba -- a Colombian -- scored at Opel Arena to thrill most in the 34,000 crowd.
Carlo Ancelotti's men reacted, with Franck Ribery wasting an opportunity before prolific Polish striker Lewandowski made it 1-1 on eight minutes.
Misfiring Thomas Mueller twice squandered opportunities to increase Bayern's lead, but on 21 minutes Dutch wing wizard Arjen Robben -- who had set up the equaliser for Lewandowski -- made it 2-1 when he headed home.
Robben, making his 150th Bundesliga appearance, should have made it 3-1 minutes later but he poked over when through on goal.
The second half was all Bayern but it took until injury time for them to make the pressure count, Lewandowski stepping up to curl the ball beautifully into the top corner from a free-kick that he had won.
It was the forward's fourth consecutive brace at Mainz.