The victory moved Madrid back up to third in La Liga above Valencia and left Malaga rooted to the bottom of the table.
Isco scored his free-kick on 29 minutes and apologized to supporters in La Rosaleda where he played as a Malaga player from 2011 to 2013.
Isco was also involved in the second when he set up Casemiro on 63 minutes.
The match-winner was taken off on 72 minutes and received an ovation from home supporters.
Diego Rolan scored a consolation for Malaga with the last kick of the game.
Real Madrid’s Casemiro said: “We controlled the game. We relaxed a bit at the end but we got the three points.”
Asked if the league now did not matter to Real Madrid, he said: “No, while it’s still not been won we have to keep going. That’s the responsibility that goes with playing for this club.”
He also had words for his team-mate Isco. “He has always been important for us and hopefully his form will continue,” he added.
Malaga scorer Rolan lamented: “It’s another defeat. We set ourselves up to be hard to beat but they have players like Isco who make the difference.”
Isco is now Real Madrid’s third top scorer in all competitions behind Cristiano Ronaldo and Gareth Bale who were both rested for this away win.
Raphael Varane and Luka Modric were also left out of Zinedine Zidane’s squad but such is the strength in depth available to the coach that his team still had enough to win the game.
Earlier Sunday, Fernando Torres scored his 100th La Liga goal for Atletico Madrid as they beat Levante 3-0.
Atletico took the lead on 33 minutes when Angel Correa scored from Vitolo’s pass and Antoine Griezmann made it 2-0 from Sime Vrsaljko’s assist three minutes into the second half.
Torres came on for Griezmann on 58 minutes and on 77 minutes he had his 100th league goal for the club when he scored from Correa’s pass.
Torres, who revealed last week he was leaving the club in the summer, said: “I hope that this is not my last goal. I’m fighting to be in the starting line-up.”
The result leaves Atletico second, 11 points behind leaders Barcelona. Real Madrid are a further four points adrift.
Also on Sunday Eibar lost 1-0 at home to Alaves and Getafe beat Espanyol 1-0.