Mainz outclassed the visitors throughout the game and could have scored several more goals, with Bayern in no mood to put up a real fight after winning their only silverware of the season last week.
Mainz took the lead with Jonathan Burkardt's missile in the 18th minute.
The hosts, who had 24 efforts towards goal compared to Bayern's four, scored again when scored Moussa Niakhate stabbed in at the far post from a corner.
Bayern had to wait a half hour for their first good chance and Eric Maxim Choupo-Moting hitting the woodwork.
They did pull a goal back with Bundesliga top striker Robert Lewandowski bagging his 18th away goal of the season for a new league record and his 34th league goal.
But just as Bayern piled on the pressure after the break Mainz struck again thanks a textbook break and a deflection of Leandro Barreiro's shot in the 57th minute to restore their two-goal cushion.
"It was not something I enjoyed. Mainz did it well. They had many chances and deserved to win. They had good energy and we did not have it," Nagelsmann said.
"After the 10th straight league title it can happen, it's human. But still the passion should be visible, the effort to not let in goals. Mainz could have scored eight or nine goals."
"We have had a few games this season where opponents had many chances."