Getafe boosts Europa League hopes
The home side came into the match on the back of three successive defeats in La Liga and things looked ominous when they fell behind to an early Carlos Vela goal.
But Pedro Leon and Abdel Barrada turned things in Getafe's favour before the interval and the scores stayed that way as Luis Garcia's men closed the gap on the top six to six points.
Sociedad are in the fourth and final Champions League spot but stay just two points ahead of Valencia with four rounds remaining.
It took only four minutes for the deadlock to be broken at Coliseum Alfonso Perez and that honour went to Sociedad.
Getafe's defence was still finding its feet when Antoine Griezmann whipped in a cross from the left wing which Vela powerfully headed home from close range.
The home side responded within minutes with a drive from Diego Castro which was fumbled away unconvincingly by goalkeeper Claudio Bravo.
And the Madrid-based club were level after 18 minutes when Pedro Leon's angled shot found the top-left corner.
Getafe were growing in confidence and Bravo was given another scare as the half-hour approached as he watched Angel Lafita's 20-yard strike whistle just wide of the right post.
Vela then threatened for Sociedad with a left-footed effort from close range which had Getafe goalkeeper Miguel Moya at full stretch to tip the ball away.
But it was the hosts who got their noses in front seven minutes before the interval thanks to Abdel, who was on hand to smash home the rebound after Bravo could only parry an initial drive from Lafita.
The second half offered few chances in comparison and 60 minutes were on the clock when Moya made the first save, getting safe hands to a free-kick from David Zurutuza.
Bravo did even better four minutes later in tipping over a set-piece from Pedro Leon, while the on-loan winger threatened again soon after with the Sociedad goalkeeper once more clearing the danger.
The visitors then ramped up the pressure in the closing stages in search of an equaliser but Carlos Martinez was wide with a header before Griezmann fired over from inside the area.