Zinedine Zidane’s side started the night three points behind Barcelona after the Catalans beat Athletic Club 1-0 at Camp Nou on Tuesday and the Frenchman picked an attacking line-up for this match.
With Casemiro out through suspension, the Madrid coach picked Vinicius, Eden Hazard and Gareth Bale along with striker Karim Benzema.
Real, having lost to Mallorca in the away fixture back in October did not have things all their own way as the visitors pushed them back in the opening 10 minutes and Courtois was called into action to palm wide a fierce effort from Iddrisu Baba.
But Zidane’s side gradually began to take control of possession and took the lead – albeit in somewhat controversial circumstances – after 19 minutes.
Dani Carvajal won the ball back and fed Luka Modric, who slid an intelligent pass to Vinicius on the left and the Brazilian chipped delicately past Manolo Reina to give Madrid the lead.
Mallorca were furious for what they believed was a Carvajal foul on Dani Rodriguez, but the goal stood after a VAR check and after all the controversy of Sunday’s 2-1 win at Real Sociedad, Madrid benefited from another call.
Vinicius went through and hit the bar shortly afterwards and Benzema tested Reina on a couple of occasions.
Madrid went 2-0 ahead after 56 minutes as Ramos curled a fantastic free-kick over the wall and into the top corner from 24 yards out.
Los Blancos rarely looked troubled after that, but their on-loan player Takefusa Kubo beat two defenders and hit a shot into the side netting later on, while Ante Budimir saw a couple of headers comfortably saved by Courtois.
In the closing stages, Mallorca’s 15-year-old Luka Romero, who is Argentine but was born in Mexico and is nicknamed the ‘Mexican Messi’, came on to make his debut and become the youngest player in LaLiga history, breaking an 80-year-old record.
Madrid move back to the top, above Barca courtesy of their superior head-to-head record, with Mallorca still third from bottom with seven games left.