Harry Kane played a part in both goals as Bayern Munich returned to winning ways in the Bundesliga with a 2-1 victory over Mainz.