Espanyol loanee Joselu scored in Madrid’s last win over Getafe before the international break a fortnight ago, setting up the winner on that occasion to make it five wins from five for Carlo Ancelotti’s side.
Ander Barrenetxea put Sociedad in front after five minutes, but Federico Valverde produced a long-range effort just after half-time before Joselu’s header on the hour gave Madrid all three points at the Santiago Bernabeu.
Jude Bellingham received praise from the home crowd before kick-off when he was named LaLiga’s Player of the Month for August after a stunning start to life in the Spanish capital.
Sociedad silenced the Bernabeu faithful in the fifth minute when Barrenetxea finally finished off a slick move for the visitors.
After building play from the back, Kieran Tierney passed to Take Kuba, who crossed for Barrenetxea, and although Madrid goalkeeper Kepa Arrizabalaga saved the Sociedad striker’s first-time effort, Barrenetxea was the first to pounce to push the ball over. line.
Kubo continued to impress against his old club Madrid, capping off a fine first half for the visitors with a cheeky nutmeg on Toni Kroos.
Madrid supporters were on their feet immediately after the break when Valverde returned from the edge of the area.
It took Ancelotti’s side just 40 seconds into the second half to equalize when he headed in a corner after being pulled out by Fran Garcia.
Garcia was also the main creator of what turned out to be the winner in the 60th minute.
Left-back Garcia was given too much space out wide and a superb delivery headed an unmarked Joselu from six yards for the Spanish veteran’s second goal of the season.
Ancelotti pulled the striker two minutes later with Luka Modric and Eduardo Camavinga featuring to help Madrid hold on for a fifth LaLiga win this season, but only after Bellingham were denied another goal when his late diving header was saved by Alex Remiro.
Madrid now turn their attention to the Champions League, which resumes in midweek, with the 14-time European Cup winners opening their campaign with a home game against Union Berlin on Wednesday.