Borussia Dortmund leapfrogged Bayern with a 3-2 win at Hertha Berlin on Sunday (AEDT), earned thanks to a late goal from captain Marco Reus, but the champion responded with its 13th win in its last 14 Bundesliga matches.
First-half goals from Robert Lewandowski, James and Kingsley Coman set up a crushing victory that sends Bayern above Dortmund on goal difference, with the leaders set to meet in a potential title decider on April 6 at the Allianz Arena.
James netted twice more after the break to claim the match ball before Alphonso Davies recorded his first Bundesliga goal, the champion having scored 17 times in its last three league games.
Bayern made a blistering start and led inside three minutes, Lewandowski steering home a near-post volley from David Alaba's left-wing cross.
The early onslaught continued with Coman rattling the crossbar and James forcing an excellent save from goalkeeper Florian Muller with a powerful low drive.
Bayern's inevitable second goal arrived in the 33rd minute, Joshua Kimmich's ball into the box chested down superbly by Leon Goretzka with James sliding home a fine finish.
And it was 3-0 before the break, Mainz losing the ball on halfway with Goretzka sending Coman clear, the winger cutting inside off the left to whip a superb strike across the helpless Muller.
Mainz could not stem the tide after the interval either, James finding the bottom-left corner with a curling 20-yard effort in the 51st minute before then securing his treble with a sublime chip.
Bayern made it back-to-back 6-0 home wins in the league by completing the scoring in the 70th minute. Muller denied Lewandowski but he was unable to stop teenager Davies smashing in the rebound.