Robert Lewandowski scored twice as Bayern Munich moved four points clear of Borussia Dortmund with a come-from-behind win in a pulsating Klassiker.