Harry Kane's injury time winner secured Bayern Munich a much needed 2-1 win after three straight defeats.