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.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.