Hansi Flick's side, which was without top goalscorer Robert Lewandowski after he sustained a knee injury on international duty with Poland, is now seven points ahead of second-placed Leipzig, with seven games remaining.
A fifth straight Bundesliga win was secured seven minutes before the interval, Goretzka powering home after smart play by Thomas Muller – a German-record 62nd consecutive match in which Bayern scored.
Leipzig came close to securing a point on a number of occasions in the second half, but its eight-game unbeaten league run, and possibly its title hopes, ultimately came to an end at Red Bull Arena.
Despite doing much of the pressing in the early stages, Leipzig was unable to trouble Manuel Neuer in the Bayern goal.
Eric Maxim Choupo-Moting fizzed wide midway through the first half before Bayern went ahead with its first shot on target in the 38th minute.
Muller pulled the ball back to Goretzka, who thundered into Peter Gulacsi's top-left corner from 15 yards for his fifth Bundesliga goal of the campaign.
Gulacsi got down well to paw away Leroy Sane's volley from outside the area as Bayern threatened to extend its advantage before the interval.
Dani Olmo twice went close straight after the break, while Neuer superbly tipped over Marcel Sabitzer's long-range drive.
Muller was denied by Gulacsi late on, but it mattered little in the end as Bayern held on for a vital three points with the minimum of fuss.