Meanwhile, bitter rivals Barcelona made it two wins in as many games under Luis Enrique with a late winner at Villarreal.
     
Madrid were without the injured Cristiano Ronaldo and departed Angel di Maria and Xabi Alonso, but still looked on course for a comfortable evening when they flew into a 2-0 lead inside the opening 11 minutes thanks to goals from Sergio Ramos and Gareth Bale.
     
However, Inigo Martinez and David Zurutuza levelled for the hosts before the break and Zurutuza and Carlos Vela sealed a much-needed win for under-fire Sociedad boss Jagoba Arrasate.
     
Sociedad had lost their opening game at newly-promoted Eibar and been dumped out of the Europa League by Russian side FK Krasnodar in midweek and appeared down on their luck after another slow start.
     
Ramos rose highest to power home Toni Kroos' corner to open the scoring before Bale left Gorka Elustondo trailing with a neat nutmeg and slotted into the bottom corner.
     
Enaut Zubikarai then had to make fine saves to prevent Marcelo and Kroos putting Madrid out of sight.
     
But it was the hosts who crucially got the third goal as Martinez slammed home at the far post from Xabi Prieto's flick on.
     
Zurutuza then levelled four minutes before the break as he powered home Alberto de la Bella's pinpoint cross from the left.
    
Humiliation
     
Iker Casillas produced a fine save to turn Imanol Agirretxe's header behind as Sociedad started the second period the stronger.
     
And they got their reward 25 minutes from time when Zuruztuza again timed his run into the box perfectly to connect with Prieto's low cross to the near post.
     
Madrid's humiliation was complete 10 minutes later when substitute Carlos Vela appeared to control the ball with his hand before spinning to fire into the top corner.

Latest News from Sports News Desk