Harry Kane fired a late winner as Bayern Munich hit back from 3-0 down at Mainz to win 4-3 and extend their lead at the top of the table to 18 points.