Kane brace sends Bayern top as Dortmund lose at Stuttgart
Heidenheim replied with two goals in three second-half minutes to equalise and Bayern needed late goals from Raphael Guerreiro and Eric Maxim Choupo-Moting to secure victory.
Bayern finish Saturday atop the table but Bayer Leverkusen can return to the top with a win on Sunday over Union Berlin.
Kane, who came into the match with 10 goals in his last five matches, wasted no time, collecting the ball with his back to goal and scoring on the turn for the opener after 14 minutes.
Kane doubled up shortly before half-time, heading in unmarked from a corner.
With Bayern cruising, manager Thomas Tuchel made three changes shortly after half-time and within ten minutes the visitors were level.
Tim Kleindienst and Jan-Niklas Beste scored in a three-minute period, the latter after a mistake from Kim Min-Jae, bringing the score to 2-2 with 20 minutes remaining.
With Bayern wobbling, former Dortmund defender Guerreiro struck his first goal for the German champions, before Choupo-Moting scored with five minutes remaining to seal the win.
Kane now has 17 goals in 11 league games since joining the German champions from boyhood club Tottenham in the summer.
Borussia Dortmund lost 2-1 at Stuttgart, the returning Serhou Guirassy giving the home side victory with a late penalty, his 15th goal of the season to stay hot on Kane's heels.
Dortmund manager Edin Terzic selected the same XI who managed a hard-fought 2-0 against Newcastle in the Champions League on Tuesday and it showed, with the lethargic visitors struggling to contain the home side.
Visiting 'keeper Gregor Kobel gave away an early but stopped Chris Fuehrich's tame effort, becoming the first Dortmund goalie in a decade to save a penalty in the league.
The visitors did open the scoring with their first shot on target, Niclas Fullkrug tapping in a ball which former Dortmund defender Dan-Axel Zagadou allowed to run through his legs.
Stuttgart struck back shortly before halftime, Jamie Leweling threading the ball perfectly for Brighton loanee Deniz Undav to score.
Guirassy, who missed two league games with a hamstring complaint, came off the bench late and converted the penalty for the win.
Dortmund have lost two and drawn one of their past three league games and sit eight points behind Bayern with just 11 matches played.
Elsewhere, Augsburg held Hoffenheim to a 1-1 draw at home. Ermedin Demirovic's second-half goal cancelled out former Man United forward Wout Weghorst's early strike.
Darmstadt and Mainz played out a scoreless draw.
In Saturday's late game, Bochum host fellow strugglers Cologne.