Osasuna should have gone ahead when Ante Budimir ran into the penalty box, but his shot lacked any accuracy.
That early scare made Real sit up, and they took the lead in the 12th minute when David Alaba tapped the opener after the Osasuna goalkeeper saved his initial shot.
Although it looked like Madrid was going to coast to another victory, the home side had other plans. Budimir made up for his earlier miss when he levelled the score two minutes after Alaba’s opener. Chimy Avila found space for himself and squared the ball across the face of the goal for Budimir who made no mistake this time.
In the 32nd minute, the home fans roared to life when their team took the lead. Following a poor clearance from the Real Madrid defenders, Avila floated the ball into the box, and Budimir controlled a flick-on before blasting the ball into the net.
The celebrations stopped when the VAR ruled the goal out for offside.
Eduardo Camavinga found Dani Ceballos with a beautiful pass. The former Arsenal man fired a shot that was saved, and Marco Asensio tapped in the rebound.
Five minutes into the second half, Avilla who had been having a great game up till then, put his team in a tough position when he conceded a penalty for a handball in the box.
Karim Benzema stepped up, but the usually clinical striker could not beat Sergio Herrera, who flew to his right-hand side to deny the French forward.
Three minutes later Osasuna defender Nacho Vidal was left bemused as the referee pointed to the spot for shirt pulling in the box.
Benzema stepped up to redeem himself, but Herrera repeated his heroics to deny the striker for the second time in less than five minutes.
Second-half substitute Vinicius Jr came on and upped the tempo with his direct running and trickery. The Brazillian came close to grabbing a goal after skipping past Osasuna defenders only to miss the bottom corner by a few inches.
The speedy winger led a counterattack before laying up Lucas Vazquez , who rounded up the scoring with an emphatic low shot into the bottom corner of the goal.
Real Madrid needs just four points from their final five games to win a record 35th league title. Ancelotti’s men know that if Barcelona drop points tomorrow, a draw in their match against Espanyol on April 30 could clinch the title.