An incredible pre-season clash saw two red cards and 10 goals, with Atletico proving far too strong for Zinedine Zidane's side in what was a stunning encounter at New Jersey's MetLife Stadium.
Atletico incredibly took the lead inside the first minute, with Costa seeing his strike deflected past Thibaut Courtois off the foot of Sergio Ramos. Costa's movement before the goal was excellent, but there was also an impressive contribution from Joao Felix, who provided the assist.
Felix was a huge doubt to make the game after limping out of his debut for Diego Simeone's side last weekend, but the big-money summer arrival was declared fit to start.
Atletico had an opportunity to double their advantage in the fifth minute when Alvaro Morata broke into a one-on-one situation with Courtois, but the striker just took a heavy touch at the vital moment.
Simeone's side had their second in the eighth minute, however, with Felix poking a low Saul Niguez cross into the back of the net to shock Los Blancos in New Jersey.
Felix almost made it three in the 10th minute after breaking to the edge of the Real Madrid box and striking towards goal, but the ball just missed Courtois's post.
Opportunities continued to arrive for a dangerous Atletico, with Courtois having to keep out a deflected Costa strike in the 15th minute as Real Madrid looked increasingly fragile at the back.
It was not too much of a surprise when Simeone's team scored their third and it was Angel Correa - on for the injured Morata - who found the bottom corner with a clever finish after smart work from Koke.
Koke also provided the assist for his team to score their fourth of the match in the 28th minute, with Costa grabbing his second of the night by finding the bottom corner from inside the Real Madrid box.
It went from bad to worse for Los Blancos as big-money summer arrival Luka Jovic had to be replaced in the 30th minute after failing to recover from an injury which he sustained in a challenge with Atletico stopper Jan Oblak.
Mario Hermoso tested the reactions of Courtois in the 32nd minute as Atletico threatened more goals late in the first period, while Thomas Lemar also fired a brilliant Kieran Trippier cross over from close range.
A rotten first 45 minutes got a lot worse for Zidane's side, however, as Costa completed his hat-trick from the penalty spot after Isco had brought the Brazilian-born forward to the ground with a poor challenge.
Costa then scored his fourth of the match in the 51st minute; again Felix provided the assist for the Spain international, who excellently lifted the ball over the onrushing Keylor Navas.
Gareth Bale was amongst those to come off the Real Madrid bench just past the hour, but not too much was made of the Welshman's entrance as two red cards were dished out shortly after.
Tempers flared when Dani Carvajal made a late challenge on Lemar, which led to Costa flying across to confront his international teammate. The referee was quickly on the scene to produce red cards for both the Real Madrid defender and Atletico striker as an incredible Madrid derby produced another moment of drama.
Atletico then scored a seventh in the 70th minute when Vitolo broke into a dangerous position before picking out the bottom corner.
Sergio Camello saw a close-range strike kept out by Navas four minutes later as Simeone's side looked for an eighth against a team that were desperately poor over the 90 minutes.
Vitolo was next to come close for Atletico as he chipped a Camello cross over from close range on a night where Real Madrid could have conceded double figures.
In the end, the night ended on somewhat of a positive for Zidane's side as Karim Benzema scored from the penalty spot after Hector Herrera had fouled Nacho inside the box, before Adrian De La Fuente netted a third for the Spanish giants in the closing stages.
Next up for Real Madrid, who have plenty to ponder ahead of the 2019-20 season, is a clash with Tottenham Hotspur in the semi-finals of the Audi Cup on Tuesday, while Atletico will continue their preparations for the new campaign against the MLS All-Stars on Wednesday.
REAL MADRID: Courtois (Navas 46'); Odriozola (Carvajal 46'), Ramos (Sanchez 62'), Nacho, Marcelo (Bale 62'); Kroos, Modric (Kubo 62'), Isco (Rodrygo 62'); Hazard (De La Fuente 62'), Jovic (Benzema 28'), Vinicius (Lucas 46')
ATLETICO MADRID: Oblak; Trippier (Munoz 66'), Savic (Felipe 66'), Hermoso (Isaac 66'), Lodi; Felix (Vitolo 66'), Koke (Llorente 66'), Saul (Herrera 66'), Lemar (Sanabria 66'); Costa, Morata (Correa 13', Camello 66')body check tags ::