Karim Benzema hit a hat-trick and Vinicius Jr also found the back of the net as Madrid recovered from a 2-1 half-time deficit.
The result took Madrid to top of the table on goal difference, with Atletico Madrid and Valencia level on points with them.
Atletico Madrid completed a sensational comeback win at Espanyol on Sunday, with Thomas Lemar scoring the winner nine minutes into injury time.
Espanyol had taken the lead through Raul de Tomas, only for Yannick Carrasco to equalise 11 minutes from time.
Substitute Lemar then won the game deep into stoppages.
Valencia are above Atletico on goal difference after also coming from behind to thrash Osasuna 4-1 away from home.
Maxi Gomez, an Aridane Hernandez own goal, Goncalo Guedes and Omar Alderete found the net.
Real Sociedad are only one point further back on nine points after two goals from Mikel Oyarzabal beat Cadiz 2-0.
On Saturday, Athletic Club had temporarily moved to the summit of La Liga with a 2-0 win over Mallorca.
The Basque side struck twice in the second half, with Dani Vivian and Inaki Williams on target on the 68th and 74th minute.
Earlier on Saturday, Levante drew 1-1 with Rayo Vallecano.
Both Barcelona and Sevilla had their matchday four fixtures rescheduled due to World Cup qualifiers that would have clashed with their fixtures. It means that Barca will have a double header of matches next week.