The match saw Takefusa Kubo and Alexander Sorloth score, giving Real Sociedad a comfortable lead at the RCDE Stadium.
Despite struggling in recent matches, Real Sociedad held on to their lead against the Espanyol side. A Kubo cross deflected off Espanyol defender Leandro Cabrera to give Real Sociedad a third goal.
Though Sergi Darder netted a consolation goal for the home side, Brian Olivan's late goal was not enough to prevent Real Sociedad from leaving with all three points.
Real Sociedad is now in third place, hot on the heels of Real Madrid, but the reigning champions still have a game in hand.
Meanwhile, Barcelona remains the league leaders, sitting 14 points ahead of Real Sociedad. Espanyol is 17th in the league, with only a one-point buffer from the relegation zone. in the absence of midfield maestro David Silva, Real Sociedad looked strong, and Mikel Merino returned from injury as a substitute.