Prior to the win against Deportivo, Madrid had lost their last two home league games against Barcelona (3-0) and Villareal (1-0).
Also, they had failed to win their last three league games (two losses, one draw).
A brace each from Cristiano Ronaldo (78th, 84th minutes), Nacho Fernandez (32nd, 89th minutes), Gareth Bale (42nd, 58th minutes) and a goal from Croatia star Luka Modric secured the massive win for Madrid.
Former Atletico Madrid forward Adrian Lopez had given Deportivo the lead in the 23rd minute.
Real Madrid remain fourth on 35 points with a game in hand in the league table.