Atletico took the lead with Alvaro Morata scoring from close range following Nahuel Molina’s low cross.
Real were 11 minutes from going out but equalised when Rodrygo beat three players and scored a wonderful goal.
Atletico’s Stefan Savic was sent off for two bookable offences, before Karim Benzema put Real ahead in the 104th minute with Vinicius Jr adding a third.
Benzema steered a low shot past Jan Oblak after the visitors had failed to deal with Marco Asensio’s low cross and Vinicius Jr sealed the victory as he passed the ball into the bottom corner after a fine run.
Barcelona and Osasuna beat Real Sociedad and Sevilla respectively in their quarter-finals on Wednesday and Athletic Bilbao won 3-1 at Valencia on Thursday to join them in the semi-finals.
The draw for the final four will take place on Monday, 30 January with the first legs in early February and the second legs in the beginning of March, before the final on 6 May.
Earlier on Thursday, La Liga said it “strongly condemns acts of hatred and intimidation against Vinicius Jr” after an effigy of the Real Madrid winger was hung from a bridge near the club’s training ground.
A banner reading “Madrid hates Real” was attached to the bridge’s railings, with Atletico calling the incident “repugnant”.
Vinicius Jr, 22, said last month the Spanish league had to act on racists attending games after a minority of Atletico fans sang racist songs aimed at the player before Real’s 2-1 win in September.
“There’s only one Madrid. We all know,” wrote the Brazil international on Twitter after his side’s win.
Madrid boss Carlo Ancelotti said: “[Vinicius] controlled the match well, he really wanted to play and he had a very good game.
“I think the goal was his reward for his great work. What happened is very regrettable.”
Home TeamReal MadridAway TeamAtl MadridPossessionHome61%Away39%ShotsHome23Away12Shots on TargetHome6Away6CornersHome7Away6FoulsHome11Away18