كتب : Hatem Maher
Gonzalo Higuain scored the winner four minutes after the restart to take his tally to 13 league goals this season.
The Argentinean forward superbly cut inside Racing's Cesar Navas inside the area before curling a right-footed shot past keeper Tono.
Defending champions Real, who had not lost or drawn since their 2-0 defeat to Barcelona in December, lie second in the league table with 47 points.
They will be hoping that their arch-rivals Barcelona, who are on top with 56 points, stumble against Sporting Gijon on Sunday.