Bayern did not have a genuine chance until 20 minutes in, when Dante rose high to meet a cross but planted his effort well wide of goal.
© Getty Images
Mainz continued to play well and Shawn Parker was the next to have a sight of goal, but he blazed an effort from just outside the box high and wide.
However, just before the break dangerman Parker finished off a swift break to send his side in ahead.
However, Bayern responded well after the break and were ahead within seven minutes of the restart.
First Mario Gotze, on at the break, played in Robben who finished calmly from inside the box before two minutes later the goalscorer found Thomas Muller to put his side in front.
The points were complete on 69 minutes through Mandzukic's close-range finish, although they added a fourth through a late Muller penalty.