Xisco fired the visitors in front after just three minutes before Ruud van Nistelrooy leveled the score from the spot five minutes later.
Skipper Raul replaced Javier Saviola, who was given a surprising starting place, to put Los Merengues ahead in the 79th minute.
A delightful counter attack released Van Nistelrooy on the left hand side of the pitch before the Dutch striker fed Raul for an easy tap-in into an empty net.
Robinho ensured the victory one minute from time following a brilliant individual effort.
The in-form Brazilian forward collected a deft pass from Guti, sidestepped two defenders before rounding the keeper and slotting home.
The defending champions are on top of the league table with 22 points, four ahead of Villarreal, who were handed a crushing 4-1 defeat to Real Zaragoza.
Elswhere, Barcelona kept up the pressure with an easy 2-0 home victory over Almeria.
Thierry Henry opened the scoring seven minutes before the interval with a close-range finish.
Argentinean prodigy Lionel Messi came off the bench to ensure the victory ten minutes from time after converting a controversial penalty.