Goretzka struck four minutes from time to earn his side a 10th straight win in the league, meaning if they beat Werder Bremen on Tuesday they will seal an eighth successive crown.
It looked like being an evening of frustration for the hosts as Benjamin Pavard’s own goal cancelled out Joshua Zirkzee’s opener for Bayern.
But the Germany international continued his fine form following the resumption of the league with his third goal in six games to leave the champagne on ice as Bayern lead Borussia Dortmund by seven points with three games to play.
Dortmund had closed the gap to four as Erling Haaland continues to make waves, the teenager coming off the bench and sealing a 1-0 at Fortuna Dusseldorf in the dying seconds.
Dortmund were lacklustre throughout and only the offside flag spared them from going behind, before Raphael Guerreiro had an effort ruled out by VAR, but just when it seemed they would lose further ground on Bayern, up popped Haaland.
The Norwegian managed to find space in the area deep into time added-on before glancing a header from Manuel Akanji’s cross beyond the despairing dive of Dusseldorf goalkeeper Florian Kastenmeier.
Haaland had only been on the field for half an hour but his 14th goal since joining Dortmund at the start of the year keeps the title race alive for another few days at least.
Fortuna faltering at the death at Merkur Spiel-Arena means they are now level on points with second bottom Werder Bremen, who stormed to a 5-1 victory at relegation rivals Paderborn.
Davy Klaassen bagged a first-half brace while Yuya Osako also struck before half-time, after which Maximilian Eggestein put Bremen further ahead. Abdelhamid Sabiri pulled one back but Niclas Fullkrug sealed the rout.
Paderborn’s defeat at the Benteler-Arena means they must win their three remaining matches simply to keep their slim chances of a relegation play-off.
Hertha Berlin took the lead through Krzysztof Piątek against Eintracht Frankfurt but the dismissal of Dedryck Boyata on the stroke of half-time proved a turning point.
Bas Dost levelled and Andre Silva scored twice, either side of Evan N’Dicka finding the net, as Frankfurt claimed an emphatic 4-1 victory at the Olympiastadion.
Wolfsburg blew a two-goal lead in a 2-2 draw with Freiburg at the Volkswagen Arena. Wout Weghorst scored twice, the second from the penalty spot, in the first half, but Lucas Holer and Roland Sallai struck either side of the break.
Marvin Friedrich and Christian Gentner helped Union Berlin to a 2-1 win at Cologne, who pulled one back in injury time through Jhon Cordoba.
In LaLiga, Barcelona hit the ground running as they cruised past Mallorca 4-0 in their first LaLiga game since the coronavirus pandemic.
The league leaders last played 99 days ago when they beat Real Sociedad 1-0, with the Spanish competition suspended soon after because of the global health crisis.
But it did not take them long to find their groove as goals from Arturo Vidal, Martin Braithwaite, Jordi Alba and Lionel Messi gave them the points on the Balearic Island and moved them five points ahead of Real Madrid in second.
Rock-bottom Espanyol benefited from the early dismissal of Alaves goalkeeper Fernando Pacheco Flores as they claimed a 2-0 win at the RCDE Stadium. Bernardo Espinosa and Wu Lei scored either side of the interval.
Manu Trigueros came off the bench to strike in time added-on as Villarreal claimed a last-gasp 1-0 victory at struggling Celta Vigo.
Real Valladolid were 2-1 victors over strugglers Leganes thanks to goals from Enes Unal and Ruben Alcarez, with Oscar scoring a late consolation for the hosts.
Napoli will face Juventus in Wednesday’s Coppa Italia final after a 1-1 home draw with Inter Milan proved enough to win 2-1 on aggregate in their two-legged semi-final.
David Ospina gifted the lead to Inter inside three minutes when Christian Eriksen scored direct from a corner and went through the Napoli goalkeeper’s legs.
The former Arsenal man made amends, though, when his long kick upfield found Lorenzo Insigne, who set up Dries Mertens to slot home the equaliser and become the club’s all-time leading goalscorer with his 122nd strike.