The England captain collected the ball from Leroy Sané on a Bayern counter-attack and took one touch before drilling the ball into the corner.
The goals were Kane’s 16th and 17th league goals of the season and he made Bundesliga history after becoming the first to score 17 in his first 11 games.
Thomas Tuchel’s men head into the November international break on a high after picking up a third straight win in all competitions following their humiliating exit from the DFB-Pokal at the hands of third-placed Saarbrucken.
The reigning Bundesliga champions gave up a two-goal lead in the second half but showed their quality to go ahead again late on to secure the three points.
Bayern opened the scoring after 14 minutes when Kane scored perhaps his best goal to date for the club since his summer move from Tottenham Hotspur. The England captain went full throttle from Leroy Sane, turned away from his man and picked out the far corner from just outside the box.
Towards the end of the first half, the same duo punished Heidenheim. Sane’s protruding corner looked deep enough, but Kane was there waiting to rise high and head into the top corner.
Kane has now scored 21 goals in 16 games in all competitions for Bayern this season, including 10 in the last four games alone.
Bayern Munich player ratings (4-2-3-1)
GK: Neuer – 5/10
RB: Noussair Mazraoui – 6/10
CB: Upameccano – 7/10
CB: Kim Min-jae – 6/10
LB: Sarr – 6/10
CM – Pavlovic – 6/10
CM: Laimer –7/10
RM: Leroy Sane – 9/10
AM: Muller – 7/10
LM: Gnabry – 6/10
ST: Harry Kane – 10/10