In a game arranged by means of compensation to Bayern for an injury picked up by Arjen Robben while on international duty ended in victory for the Bundesliga club while Robben made an appearance in a Holland shirt.
Toni Kroos put Bayern in front, but Klaas Jan Huntelaar and Luciano Narsingh turned the game around within minutes.
Nils Petersen brought Bayern level before half time and Mario Gomez scored the winner later on as Bayern won in front of only a half-full stadium in Munich.
Kroos gave Bayern the lead in the 17th minute with a fine 25-yard effort which struck the underside of the bar on its way in.
Their lead lasted less than a minute, though, with Huntelaar replying.
The Schalke striker and Bundesliga top goalscorer this season was put through by Dirk Kuyt and threaded the ball inside Hans-Jorg Butt's near post.
The Dutch took the lead two minutes later when Holger Badstuber pushed up and got the offside trap all wrong, allowing Narsingh a free run on goal, and he chipped the ball over Butt.
Bayern levelled in the 28th minute with Petersen heading in a cross from Ivica Olic from six yards out.
Robben came on for Holland in the 75th minute, receiving boos from parts of the 33,000 fans whenever he touched the ball.
Franck Ribery also came on for Bayern and he set up Gomez to tap in the winner in the 87th minute to give the Bavarians something to smile about at the end of a disappointing few days and an equally disappointing season.