That was just enough to advance to the Champions League last four and stay on track for their 10th crown.
Two first-half goals by Marco Reus, both coming from Real mistakes, gave Dortmund a deserved lead as the Spaniards, who had a penalty saved in the 17th minute, were left mesmerised by the Germans' frantic pace.
Real, with top scorer Cristiano Ronaldo left on the bench due a minor knee injury, saw their 3-0 advantage from the first leg in Madrid almost evaporate in a disastrous first half.
Real, who twice lost to Dortmund in Germany in last season's competition, including a 4-1 thrashing in the first leg of their semi-final, briefly recovered in the second period before the Germans, last season's runners-up, again surged forward, missing half-a-dozen clear scoring chances and also hitting the post.
"That was too much suffering and I think it was deserved," said Iker Casillas, the Real goalkeeper. "But from time to time it's good to have this kind of wake up call that reminds us it's not always easy, and especially not in the Champions League."
Dortmund had got off to a fiery start, looking for an early goal that could set them on their way.
Real, however, squandered a golden opportunity to take the lead and put the tie all but beyond the hosts when they were awarded a penalty for a handball by defender Lukasz Piszczek and Angel Di Maria had it saved by Roman Weidenfeller.
A minute later it was Dortmund's turn to miss with Henrikh Mkhitaryan firing wide from close range but Reus made amends in the 24th minute, pouncing on a defensive mistake by Pepe to slot in for the lead.
Mats Hummels almost added another as the hosts piled on the pressure but his well-timed header was palmed over the bar by Real keeper Iker Casillas.
Reus then crashed in his second goal in the 37th minute when he charged forward after another Real mistake - this time from Asier Illarramendi - fed striker Robert Lewandowski who hit the post, and drilled in the rebound at the far post.
Dortmund, though, lost some of their passing sharpness and pace in the second half and could not find the back of net, although Mkhitaryan rounded Casillas and hit the post.
The Germans have left, but they leave with their heads held high.