Malaga drew 1-1 at Milan to progress to the knockout stages of Europe's elite club competition, but goals on the counter-attack from Mexico striker Carlos Vela and Xavier Prieto condemned Manuel Pellegrini's men to a second consecutive home defeat on Saturday that sees them remain fifth in the La Liga table.
The Qatari-owned club have 18 points from 11 games, 10 behind unbeaten leaders Barcelona who visit Real Mallorca on Sunday.
Champions Real Madrid – third with 20 points – also visit Levante on Sunday.
Bottom club Osasuna earned their first points on the road this season with a 3-0 victory at fellow strugglers Espanyol.
Rayo Vallecano and Real Zaragoza capitalised on red cards for their opponents to come back from two goals down to beat Celta Vigo 3-2 and Deportivo La Coruna 5-3 respectively.
Former Arsenal striker Vela struck inside the first minute for Sociedad at the Rosaleda, sliding home a low cross.
Javier Saviola levelled for Malaga following a corner in the 37th minute but the bright orange shirts of the visitors always looked sharp on the break.
A lucky deflection and a composed finish from Prieto restored Sociedad's lead after 59 minutes and they held on for a first away win since January.
In Barcelona, Osasuna's Alvaro Cejudo netted a scrappy opener and after the hosts had twice hit the woodwork, Kike Sola dribbled round the keeper to make it 2-0 in the 63rd minute.
Manuel Onwu broke away to seal the points near the end and disgruntled Espanyol fans whistled as they filed out of the exits.
The result eased the pressure on Osasuna coach Jose Luis Mendilibar, ending a run of five games without a win in all competitions.
"If I was hanging by a thread before, I still am now," Mendilibar said. "This isn't about one day, it is a marathon and there are many kilometres left to run."
Rayo made the most of a harsh second yellow card for Celta's Gustavo Cabral just before halftime, with a stirring second-half display in Vallecas.
Celta striker Iago Aspas produced a two-goal blast after twice sprinting clear of a leaden home defence in the opening 33 minutes but Rayo used the flanks well to hit back.
Leo Baptistao headed Rayo's first and Tito nodded the equaliser in the 72nd minute before a disputed penalty allowed Piti to claim the winner from the spot.
Deportivo's week went from bad to worse after announcing on Thursday they were on the brink of entering administration, as they squandered an early two-goal lead in Zaragoza.
Apono pulled one back for the hosts from the penalty spot before the break and Depor fell apart after Pizzi received a second yellow card for diving in the 49th minute.
Paco Montanes volleyed Zaragoza level and headers from Alvaro Gonzalez and two goals from Portugal striker Helder Postiga made it 5-2 before substitute Rodolfo Bodipo notched a late consolation goal for the visitors.
- Sports & Recreation
- Real Zaragoza
- Carlos Vela
- Real Mallorca
- Manuel Pellegrini