The struggling hosts defended stoutly for the first half-hour but the league leaders managed to find the breakthrough on 33 minutes.
A defensive clearance from a corner fell neatly for Franck Ribery, who was on hand to rifle a volley through a crowd of bodies and into the net at the far post.
Bayern dominated possession but Mainz, to their credit, did not let their heads drop and enjoyed a bright spell of pressure edging into the latter stages of the opening 45 minutes.
However, they fell further behind on the stroke of half time when Corentin Tolisso found the unmarked James Rodriguez at the far post, the Colombian controlling the ball and striking a half-volley from close range.
The hosts spurned a number of gilt-edged chances, with Robin Quaison rifling just wide after breaking through with just Ulreich to beat on 75 minutes.
Ultimately Bayern were able to see the game out to extend their lead at the top of the table, while Mainz slip into the relegation playoff zone.
MAINZ 05 (3-5-2): Zentner; Bell, Hack, Diallo; Donati, Oztunali (Quaison 46'), Gbamin, Latza, Holtmann (Berggreen 73'); Maxim (Serdar 57'), Muto
BAYERN MUNICH (4-3-3): Ulreich; Rafinha, Boateng, Hummels, Bernat; Tolisso, Rudy (Alaba 70'), James; Muller, Ribery (Coman 82'), Wagner (Lewandowski 63')