Lahm said that any win in injury time is fortunate, but he was pleased with the patience that Bayern showed in the second half to get themselves back in the game.
"When it's 1-1 just a few minutes from time, then of course it's a lucky win," he told Bundesliga.com. "We were not as clinical as usual.
"We showed in the second half how we can play patiently. Stuttgart did a good job. Now everybody wants to be the first opponents to beat us."
Bayern are 13 points clear at the top of the Bundesliga after 18 games.