The 31-year-old Englishman came on as a substitute in the second half and almost immediately made the move pay off, floating a free kick that defender Sergio Ramos headed home for the winner in the 74th minute.
Madrid archrival Barcelona, meanwhile, continues to struggle away from home. Goals from Frenchman Robert Pires and Marcos gave Villarreal a 2-0 win over Barcelona to cut the Catalan club's lead at the top of La Liga to one point over Sevilla, a 4-1 winner over Athletic Bilbao.
La Liga Race (7 games to play)
1. Barcelona 59 points;
2. Sevilla 58;
3. Real Madrid 57.
4. Real Zaragoza 53;
4. Valencia 53.
Both Manchester United and Chelsea tied to leave United three points ahead of the Blues with four games to play.
Australian Mark Viduka's equalizer right before halftime gave Middlesbrough a 1-1 tie with United. Chelsea's 0-0 tie at Newcastle ended a streak of nine consecutive league wins.
Premier League Race (4 games to play):
1. Manchester United 82 points;
2. Chelsea 79.
Schalke 04, which has never won the Bundesliga title since its formation in 1963, stayed on top with a 2-0 victory over Energie Cottbus thanks to an own goal and a goal by defender Marcelo Bordon four minutes later.
Werder remained two points behind after a 3-1 win over Alemannia Aachen. Two goals by Brazilian Cacau gave third-place Stuttgart a 2-0 win over Bayern Munich and all but eliminated the two-time defending champion from contention.
Bundesliga Race (4 games to play):
1. Schalke 04 62 points;
2. Werder Bremen 60;
3. VfB Stuttgart 58;
4. Bayern Munich 53.
AZ and Ajax joined PSV in a tie for first place after leader and defending champion PSV could only draw Utrecht, 1-1, on the road.
Meanwhile, AZ beat Heerenveen, 3-1, and Ajax defeated Sparta, 5-2. Simon Cziommer and Wesley Sneijder scored twice for AZ and Ajax, respectively.
AZ, which has not won the title since 1981, has the edge thanks to a superior goal difference, six better than Ajax and seven ahead of PSV. Next weekend, AZ and Ajax are on the road against Excelsior and Willem II, respectively, while PSV is at home against Vitesse.
Eredivisie Race (1 game to play):
1. AZ 72 points;
1. Ajax 72;
1. PSV 72.