Borussia Dortmund scored twice in a dramatic stoppage-time finale, including a controversial offside goal, to beat Malaga 3-2 and reach the Champions League semi-finals for the first time in 15 years.