Goals by Andreas Ivanschitz and Aristide Bance put the home side 2-0 up at the break in Mainz on Saturday and it could have been worse for Bayern had Bance not hit the bar and missed a couple of glorious chances too.
Bayern attacked hard after the break and Mainz's Nikolce Noveski turned Bayern sub Thomas Mueller's shot into his own net to reduce the arrears just two minutes after the restart, but it was not enough.
The defeat was Bayern's first loss to Mainz in seven league meetings and Lahm, standing in for the injured Mark van Bommel, said his side had gone in with the wrong attitude.
"If you don't have enough aggression and go into the game with the wrong attitude, it can make things difficult even in Mainz," said Germany defender Lahm.
"The first half was a catastrophe."
Two draws and a defeat is not the kind of start wanted by Bayern coach Louis van Gaal who took over in July and replaced Jürgen Klinsmann after he was sacked in April having only been in charge for ten months.
The Dutchman has failed to impress with just two points from three games and, as Klinsmann discovered to his cost, Bayern bosses Karl-Heinz Rummenigge and Uli Hoeness have limited reserves of patience.
"The way we started is very disappointing," said van Gaal. "It was a false start. We tried to put it right in the second half, but that's always too late in football.
"You have to get going from the first minute. I'm asking myself what we did wrong in our preparations.
"You just can't start the way we did. That was our problem."
Bayern's Germany midfielder Bastian Schweinsteiger expressed his frustration at a game Munich dominated statistically, but came off second best.
"The match stats all point in our favour again, but we're not scoring and we're conceding goals out of the blue," he said.
"What's much worse is that in the first half, we failed to show the passion Bayern Munich has to show."
After the final whistle, Bayern's glum faces were mirrored by delight from Mainz's coach and president, whose club only won promotion from the second division last season.
"I'm just so proud of what the team's achieved, hats off to them," said Mainz coach Thomas Tuchel.
"It's a sensational result. I was really pleased with the first half.
"I don't think Bayern showed up in our penalty area once, and we deserved to lead 2-0."
Mainz president Harald Strutz was delighted his long wait to beat Bayern Munich was at last over.
"I've been President of the club for 21 years, and we've finally beaten Bayern now, so that's very special," he said.
"We deserved the win. The team performance was just sensational."
With Bayern already five points behind early league leaders Bayer Leverkusen and Schalke 04, van Gaal and Munich can ill-afford many more defeats like the nightmare in Mainz.