Isco opened the scoring against his former club in the 29th minute before assisting Casemiro in the 63rd minute to leave Malaga, who netted a late consolation through Diego Rolan, rooted to the bottom of the table - 14 points from safety with six games left.
Real Madrid boss Zinedine Zidane made six changes to the team that started against Juventus in the Champions League on Wednesday night, with Cristiano Ronaldo and Gareth Bale among those dropping out.
Real Madrid forward Karim Benzema had the first half-chance of the match in the third minute, but the Frenchman could only bundle the ball wide of the Malaga post.
Benzema had another shooting opportunity for the visitors in the 14th minute when Isco released the centre-forward, but his effort never threatened to test the home side's goalkeeper Roberto Jimenez.
Jimenez was called into action in the 16th minute, however, with the stopper making a fine stop to keep out a powerful Mateo Kovacic header. Lucas Vazquez then fired over the Malaga crossbar in the 23rd minute before Benzema headed just wide two minutes later as opportunities continued to arrive for Zidane's team.
Real Madrid eventually made the breakthrough in the 29th minute when former Malaga midfielder Isco curled a wonderful free kick into the corner of the net.
Isco came close to making it 2-0 in the 33rd minute when he broke into the home side's penalty box before striking towards goal, but the ball just missed Jimenez's near post.
Manuel Iturra had Malaga's best chance of the first half in the closing moments following a mistake from Casemiro in a dangerous position, but the midfielder could not find a route past Los Blancos goalkeeper Keylor Navas as Isco's set piece separated the two teams at the interval.
Benzema had a super chance to double Real Madrid's lead early in the second period, but the Frenchman saw a Vazquez cross taken off his head at the final moment by Malaga defender Federico Ricca.
The home side's first opportunity of the second half fell to substitute Alberto Bueno just before the hour, but the striker could not beat Navas with a header.
Real Madrid doubled their advantage in the 63rd minute when a brilliant team move was finished off by Casemiro, who slotted a low Isco cross into the back of the net.
Navas had to keep out a Castro free kick down the other end as Malaga looked to hit back, but Madrid were still looking for more goals, and substitute tested Borja Mayoral 15 minutes from time. Ramos came closest to scoring a third for the visitors late on, but the club captain could not find a route past Jimenez.
The home side did find the back of the net with the final kick of the match, though, as a mistake from Jesus Vallejo allowed Rolan to fire home as the Malaga supporters were given something to cheer about in the 93rd minute.
MALAGA (4-4-1-1): Roberto; Rosales, Torres, Miquel (Ivan 71'), Ricca; Rolan, Lacen (Bueno 53'), Iturra, Chory; Adrian; Ideye (Lestienne 78')
REAL MADRID (4-3-3): Navas; Carvajal, Vallejo, Ramos, Theo; Kovacic, Casemiro, Isco (Mayoral 72'); Vazquez, Benzema, Asensio (Ceballos 66')