Ronaldo: Hero to villain for Real
The Portuguese forward had not found the net since the middle of December but slammed two goals past the visitors in four minutes just before the break.
Real were cruising to victory in the second half when Ronaldo tried to spin away from the close attention of Malaga defender Patrick Mtiliga in his own half.
As he tussled with the Dane, Ronaldo swung his arm behind him and caught Mtiliga in the face to earn a straight red card and leave Real with 10 men for the last 20 minutes.
Barcelona top the standings with 49 points from 19 games at the mid-point of the season after beating Real Valladolid 3-0 on Saturday.
Real's win cut Barca's lead back to five points and moved them five clear of third-placed Valencia who were held 0-0 at Tenerife.
Real Mallorca are fourth with 34, ahead of Deportivo La Coruna on goal difference, after Mallorca's Borja Valero scored a disputed 80th-minute penalty to earn a 1-1 draw at Espanyol.
Depor were 3-1 winners over visiting Athletic Bilbao on Saturday.
At the Bernabeu, Hamburg-bound striker Ruud van Nistelrooy was given a warm send-off by the crowd before the start of Real's match.
Xabi Alonso headed against his own crossbar early on but the main action was down the Malaga end.
Guti's return to favour greased the wheels in midfield and it was his pass that set in motion a flowing move which led to Kaka crossing low for Ronaldo to score in the 36th minute.
Soon after, Guti found Ronaldo again and the Portuguese spun on the spot and smashed a fierce drive past Gustavo Munua from outside the area.
In Tenerife, Valencia struggled to impose themselves on a side 18th in the table.
Valencia goalkeeper Cesar kept them in the game and when the chances did fall their way towards the end, they could not find a way past Sergio Aragoneses in the home goal.
At the foot of the table, Xerez's change of coach failed to inspire them as they lost 2-1 to Osasuna and remain 20th, below the two clubs promoted with them from the second division last year, Real Zaragoza and Tenerife.