Jhon Cordoba gave the visitors a 23rd minute lead but Sergio Canales levelled things up before the interval, courtesy of a deflected strike.
Sociedad were the better of the two sides in the second half but, just when it looked as though the visitors were to survive the onslaught, former Arsenal man Vela bagged a winner in stoppage time.
Valencia left it late to secure a draw 1-1 against Osasuna in La Liga.
Oriol Riera followed up a Roberto Torres effort with 19 minutes on the clock to open the scoring for the home side but Jonas struck an 82nd minute equaliser to ensure a share of the spoils.
Levante and Getafe played out a 0-0 draw at the Ciutat de Valencia stadium.
The home side had the better of a turgid game but could not breach the Getafe defence even after Alexis had seen red late on.
- Sergio Canales