RB Leipzig survived a late onslaught to consolidate fourth spot in the standings thanks to a 3-2 win against the ten men of Borussia Dortmund.