Barcelona and Atletico Madrid have a game in hand over the Blancos but, for 24 hours at least, the capital-based club sits level on 50 points with its competitors.
The victory was a personal landmark for the Italian as it was the 500th competitive win of his coaching career, and he was in a celebratory mood afterwards.
"This was a good opportunity to go joint-first for the night," Ancelotti told reporters. "At least we will sleep well tonight.
"Gareth Bale played well. The whole team played well for the whole game. There was a lot of concentration. We defended well. We are happy because these can look like easy matches before then become a problem."
Ancelotti's 24 wins in La Liga follow his 49 triumphs in Ligue 1, 67 victories for Chelsea in England and 360 successes in Serie A.
Another milestone in the match was Karim Benzema's 100th goal for Real Madrid, as he joined Cristiano Ronaldo, Bale, Angel Di Maria and Alvaro Morata on the score sheet.
Real Madrid travels to face Espanyol in the first-leg of their Copa del Rey quarterfinal on Wednesday.