The win was the fifth in a row in La Liga for Zinedine Zidane's side following a slow start to the season for the Spanish giants.
After the match, Zidane said: "It was a really difficult game. We knew it would be tough. They pressed us high, we didn't bring the ball out well in the first half. The second half was much better.
"They're six games in a row now, that isn't easy... We've beaten a good team, that have got a lot of good results. We have to be happy, thanks to the players."
The hosts dominated proceedings for the most part in the opening 45 minutes with nothing to show for it and saw Rodrygo stretchered off with an injury in the 38th minute as Marco Asensio came off the bench to replace him.
Madrid took the lead just before the hour mark when Casemiro headed home from close range from a nice ball into the area by Asensio to make it 1-0.
"We know he gets into the box, what he is defensively, but also offensively," Zidane said of Casemiro. "It was a really nice move. He's good with his head."
Karim Benzema added one more for Real in second-half stoppage time when he cut across the top of the penalty area and fired a left-footed shot back across the goal to reach the final scoreline.
The result brings Real Madrid level on points with leaders Atleti, but Diego Simeone's side has two games in hand over their crosstown La Liga rivals.
The victory also took Zidane's side six points clear of third-placed Real Sociedad and the title race looks more and more like being a two-horse race between the two teams from the Spanish capital.
"We'll keep working hard. There are a lot of games," Zidane added. "We have to be happy, they're six wins in a row. We'll keep going, that's all I ask of the players. They'll have two or three days with their families and then back to work again."