Former England manager Steve McClaren and his Wolfsburg side were denied a point as Germany’s vice-captain latched onto Franck Ribery’s cross for the winner with seconds remaining.
“It is not my main task to score goals in games and I don’t manage it very often, but it was nice to get the winner,” said a beaming Schweinsteiger.
Bayern made the perfect start as Germany’s Thomas Müller, the top-scorer at last month’s World Cup, scored the opening goal after just nine minutes, only for Edin Dzeko to equalise after the break.
“It is a big relief to get the win,” said Müller.
“If you play as badly as we did in the first ten minutes of the second half, you don’t really deserve to win. We had to fix a few things. We tried everything again and again, and it worked.”
With winger Arjen Robben and striker Ivica Olic out with injuries, Bayern coach Louis van Gaal opted to start with Miroslav Klose as the lone striker with Müller, Toni Kroos and Ribery completing a potent attacking quartet.
The defending champions took the lead when Müller received a lobbed return pass from Germany team-mate Kroos, flicked the ball past a defender and volleyed into the bottom-right corner.
It was 1-0 at the break, but Wolfsburg had their fair share of chances in the second half as Croatia striker Mario Mandzukic beat Munich goalkeeper Hans-Joerg Butt, but could only hit the post on 47 minutes.
Dzeko got close with several chances, as did Wolfsburg play-maker Zvjezdan Misimovic, who came on at the half-time break.
With Wolfsburg pounding the Munich defence, last season’s top-scorer Dzeko finally opened his Bundesliga account for the campaign as the Bayern defence left him unmarked and he headed home from a Misimovic corner on 55 minutes.
With time almost up, Schweinsteiger scored a trademark goal when he was left unmarked at the far post and stabbed the ball around Wolfsburg goalkeeper Diego Benaglio to claim the three points.
“It was the worst way to lose,” said McClaren.
“We got kicked good and proper, we gave Bayern too much respect in the first half, we were more positive in the second half and got our rewards.
“We weren’t good enough in the end.”
Last year’s runners-up Schalke travel to Hamburg on Saturday, with Bayer Leverkusen at Borussia Dortmund on Sunday.
There was trouble in the Bayern camp before kick-off on Friday night when Argentine centre-back Martin Demichelis refused to attend the Allianz Arena game after failing to make the starting line-up.
Bayern coach Louis van Gaal opted to select Daniel van Buyten and youngster Holger Badstuber in the heart of Munich’s defence, leading Demichelis to boycott the match in protest, and say he now wants a transfer.
“The truth is that a cycle is ending and it’s better for both sides if we go our separate ways,” Demichelis told Bild newspaper.
“I don’t think it is fair to remain with the team if the signs point to separation.”
The 29-year-old played in the World Cup and was in the Argentina side that lost 4-0 to Germany in the quarter-finals.
“I made my decision and the player must accept it. He won the title last season, but now has been replaced and he must accept that, it’s not easy,” added van Gaal.
With Badstuber and van Buyten as centre-backs, van Gaal opted to play Diego Contento, 20, at left-back.
Demichelis has been at Bayern since 2003, but chairman Karl-Heinz Rummenigge ruled out releasing him before the summer transfer window closes on August 31.