Harry Kane scored the winner off the subs' bench as Bayern Munich fought from three goals down to a 4-3 triumph at Mainz on Saturday after the freshly crowned Bundesliga champions almost paid the price for fielding a much changed line-up ahead of their big Champions League semi-final at Paris Saint-Germain.
Mainz led 3-0 from Dominik Kohr in the 15th, Paul Nebel in the 29th and Sheraldo Becker on the stroke of half-time against a Bayern team changed on eight positions from a mid-week German Cup win at Bayer Leverkusen.
Bayern coach Vincent Kompany made amends as Kane and Michael Olise came on for the second half and Jamal Musiala a little later. Bayern then duly turned the match around from Nicolas Jackson in the 53rd, Olise in the 73rd, Musiala in the 81st and Kane in the 83rd.
Bayern could have afforded a second league season defeat, having clinched a 35th national title with four games to spare last weekend.
The players celebrated wildly as the big comeback boosted confidence for Tuesday's first leg match at Champions League title holders PSG as part of their treble bid.
"Eeveryone is very happy. it does us good to go to Paris with this feeling," Musiala told Sky TV.
Leon Goretzka, the captain on the day, added: "We managed to keep up the momentum. It is almost greater to win like this than 3-0."
Mainz captain Nadiem Amiri said the game "shows why Bayern are the best team in the world.
"We played an unbelievable first half and knew what we would face in the second half. But it is hard to defend against this unbelievable quality," he said.
Teenager Bara Ndiaye got his starting 11 debut and 16-year-old Bastian Assomo was part of the squad for the first time while Joshua Kimmich and Dayot Upamecano were not even part of the Bayern squad.
The reserves performed a disastrous first half and it could have been worse than 3-0 had not Jonas Urbig, in goal for Manuel Neuer, made a handful of big saves.
Kohr volleyed the opener in the 15th, Nebel netted on the rebound of a shot from Nadiem Amiri after almost half an hour, and Becker poked the third after Urbig had deflected a shot from Amiri against the crossbar.
But like three weeks ago in Freiburg, where they won 3-2 in similar circumstances from 2-0 down, Bayern became serious when the stars came on.
Jackson ignited the comeback, Olise scored a trademark stunner into the top left corner and his cross was eventually converted by Musiala before Kane poked the winner for his 33rd league goal after Daniel Batz had saved a first effort from Musiala.
Bayern raised their league record goal tally to 113 and fought back from three goals down for only the second time in their 61 years in the top flight, the first being in 1976 in a 6-5 win at Bochum.
Bayern's next league opponents between the two PSG games are bottom club Heidenheim who would have been relegated with defeat against St Pauli.
But they won 2-0 from Budu Zivzivadze and Eren Dinkci to move within four points of their Hamburg opponents who occupy the relegation play-off spot. Between the two in second last are Wolfsburg who drew 0-0 with 10-man Borussia Mönchengladbach.
"We prepared in a way that the worst-case scenario was not on our minds," long-serving Heidenheim coach Frank Schmidt said. "If we want to achieve something crazy we need a result in Munich."
Hoffenheim and Bayer Leverkusen meanwhile claimed 2-1 victories away from home in the battle for top four finishes and Champions League football.
Hoffenheim got a club record 17th season victory courtesy of Fisnik Asllani and Tim Lemperle at lowly SV Hamburg who got a temporary equalizer from Robert Glatzel's penalty.
