A loss at Levante was followed by another defeat to Manchester City in the Champions League in midweek but Zinedine Zidane's side found the perfect response on Sunday night.
Thibaut Courtois had kept Madrid in the match with a handful of fine saves, while at the other end of the pitch Marc-Andre ter Stegen showed his class with a superb stop to deny Isco.
That was before Vinicius made the breakthrough in the 71st minute, and substitute Mariano wrapped up the victory in stoppage time to lift the hosts a point above their arch rivals at the summit.
Youssef En-Nesyri's injury-time goal gave Sevilla a 3-2 home success against 10-man Osasuna and saw Julen Lopetegui's side move up to third place in LaLiga.
The Morocco international opened the scoring and Lucas Ocampos doubled the lead just before the break. Things got worse for the visitors when goalkeeper Sergio Herrera was sent off early in the second half.
However, Osasuna rallied and goals from Aridane Hernandez and Roberto Torres levelled things up. En-Nesyri then headed a late winner for Sevilla.
Getafe moved up to fourth after Nemanja Maksimovic's strike saw them win 1-0 at Mallorca, who had Salvador Sevilla dismissed in the final minute.
Atletico Madrid slipped to fifth spot after being held to a 1-1 draw at bottom club Espanyol. Stefan Savic's own goal gave the hosts the lead before Saul Niguez equalised.
Villarreal's European hopes were dealt a blow with a 1-0 defeat at Athletic Bilbao, Raul Garcia netting the game's only goal from the penalty spot.
There were just two Serie A matches but they produced 16 goals as Atalanta won 7-2 at Lecce and Roma edged Cagliari 4-3 at the Sardegna Arena.
Duvan Zapata scored a hat-trick for Atalanta, who were set on their way to victory by a Giulio Donati own goal. Josip Ilicic, Luis Muriel and Ruslan Malinovskiy were also on the scoresheet for the visitors, who stayed fourth in the table.
Riccardo Saponara and Donati netted for Lecce, who fought back from two goals down to level up the match at 2-2 at one stage.
In Sardinia, Joao Pedro opened the scoring for Cagliari but Nikola Kalinic's double and a goal from Justin Kluivert turned the game on its head. Gaston Pereiro pulled one back for the hosts but Henrikh Mkhitaryan restored Roma's two-goal cushion, before Pedro replied again late on.
RB Leipzig lost ground in the race for the Bundesliga title as they drew 1-1 at home against Bayer Leverkusen, who led through Leon Bailey's 29th-minute strike.
Patrik Schick quickly equalised but Leipzig were unable to find a winning goal and they slipped three points behind league leaders Bayern Munich.
Union Berlin squandered a two-goal lead and had to settle for a 2-2 draw against Wolfsburg. Sebastian Andersson and Marvin Friedrich scored either side of half-time to put Urs Fischer's side in control but Yannick Gerhardt and Wout Weghorst replied.
Benjamin Andre's second-half header kept Lille in the hunt for Champions League qualification in Ligue 1 as they won 1-0 at Nantes.
Nicolas de Preville and Adam Ounas were on target as Bordeaux and Nice shared the points in a 1-1 draw, while Moussa Dembele scored both of Lyon's goals, the second from the penalty spot deep into injury time, as they won 2-0 at home against St Etienne.