Guardiola's men secured their 18th straight league victory as late goals from Bastian Schweinsteiger and Mario Gotze earned them the points 2-0.
Victories for Borussia Dortmund and Schalke ensured that Bayern had to wait to clinch a 24th German crown, despite their triumph at the Coface Arena.
However, the Bavarians will win the league and defend their title if they overcome Hertha Berlin in the capital on Tuesday.
Guardiola was quick to hail his players as they beat a team who he described as one of their toughest opponents of the campaign.
"We have played against a very strong opponent and won," Guardiola told Bayern's official website.
"We have extended the record to 18 wins in a row. There is hard work behind it. I'm just happy we won against one of the toughest opponents of the season.
"Now we are only missing a victory. We have the chance to become German champions in the capital on Tuesday."
Meanwhile, Schweinsteiger admitted that Mainz had made life difficult for Bayern with their aggressive style of play.
"In Mainz victories are always hard-fought," the Germany international said. "They are a very aggressive team that presses very high.
"It was not easy in the first half. But they were tired in the end.
"When we become champions (it) is all the same to us. We want to keep our rhythm up."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.