With a 3-0 first-leg advantage, the Blancos looked firm favourites heading into Tuesday's game but Angel Di Maria's saved penalty and a first half brace from Marco Reus set Madrid nerves jangling.
They survived more Dortmund pressure in the second period, Henrikh Mkhitaryan striking a post while Iker Casillas was also called upon to make some crucial saves, and their coach confessed that his charges had almost paid for their poor second-leg showing.
"All games at this stage are very difficult," Ancelotti mused to reporters. "We are fortunate to be through to the semi-finals.
"We're happy to reach the semis, but not happy as we suffered a lot. Especially in the first half. We opened the tie up again.
"We were better in the second half. Football is like that, we gave away gifts, made lots of errors, we had no confidence and we suffered because of it.
"Casillas made fantastic saves in important moments of the game. His game was very, very good."
Bayern Munich or Manchester United and Atletico Madrid or Barcelona, who play on Wednesday, will join Real Madrid and fellow Tuesday victors Chelsea in the last four of the elite European competition.