Karim Benzema broke the deadlock in the 13th minute with his ninth goal in his last seven league games, finishing Lucas Vazquez’s cross with an impudent backheel.
Madrid doubled their lead before the half hour mark when Toni Kroos’ free kick deflected against Sergino Dest’s back and flew past Jordi Alba on the line.
Barcelona fought back in the second half in torrential rain, with Oscar Mingueza pulling a goal back from close range.
Substitute Ilaix Moriba almost equalized in stoppage time, but hit the crossbar.
Atletico Madrid travel to face Real Betis on Sunday and could go back top with a point, currently level with Real on 66. Barcelona are third on 65.
Barcelona complained of two penalty decisions they were not given, with Ferland Mendy clashing with Ousmane Dembele and later Martin Braithwaite in the area.
"I think everyone saw the game, if you’re a Barcelona fan you’re furious, very unhappy about the two refereeing decisions," said Barcelona coach Ronald Koeman.
"In the first half we were not good in attack or defence, in the second we improved. It’s a very clear penalty, once more we have to shut up and accept it."
The Barcelona coach later walked out of a pitchside interview after a reporter did not answer his question about whether his team should have been given a penalty.
Neither incident was clear cut, and Madrid could have put the game to bed in the first half when Fede Valverde hit the post with the score already at 2-0.
Barcelona captain Lionel Messi hit the post near the end of the first half direct from a corner, before Mingueza put his team back in the game after 60 minutes.
However Madrid held on to win an entertaining Clasico despite a nervy finale.
"Above all I'm happy for [the players], we made a lot of subs today, we suffered but nothing changed," said Zidane. "They are all committed and they want to play and that's the good thing.
"We have to enjoy today and the other day," he said, referring to the team's defeat of Liverpool in the Champions League.
"We got two good results and we have to rest well.
"I don't know how the season will end but we'll need everyone, we're phsically at the limit, it's hard for us to finish games."
Earlier Cadiz and Levante won 1-0 at Getafe and Eibar respectively, while Athletic Bilbao drew 0-0 with Alaves.