Italy's Fabio Fognin
Victory means Barca only have to beat Alaves on Tuesday and then Levante next Saturday to be crowned champions at Camp Nou, while three points against Alaves will be enough on its own if Atletico Madrid then lose to Valencia on Wednesday.
Whether in three days or seven, it is now surely only a matter of when rather than if Ernesto Valverde's side successfully defend their trophy, despite Atletico keeping the gap to nine points after they edged past Eibar earlier on Saturday.
"We have to get it out of our heads that we are nine points clear," Valverde said. "We now have three days until we play again and it will be difficult."
Wrapping it up early though would allow Barcelona the luxury of focusing completely on the Champions League, which could give them an advantage over their semi-final opponents Liverpool, who seem to be embroiled in a Premier League race to the finish with Manchester City.
But this was no stroll, with Real Sociedad pulling level in the second half thanks to Juanmi's equaliser, even if parity lasted less than two minutes.
Lionel Messi might not have scored but it was his cute pass that teed up the excellent Alba to score the winner after Lenglet had earlier powered in a header from Ousmane Dembele's cross.
- Barcelona racing towards title -
Barcelona stumbled out of the blocks this season but they are now tearing down the home straight.
This was their 21st league game without defeat while Real Madrid sit 16 points behind them ahead of their game at home to Athletic Bilbao on Sunday.
"You always look at the matches of Real Madrid because you always consider them a rival," Valverde said. "In their case, they may be thinking about next season."
It was a surprise when Messi failed to score with two free-kicks in the first half while Sociedad could have been in front but Juanmi was denied by Marc-Andre ter Stegen and Willian Jose spurned the rebound.
There was nothing complicated about Lenglet's opener, the Frenchman rising high above two defenders and heading into the corner for his first league goal in a Barcelona shirt.
Ter Stegen and Alba were fortunate not to be punished for a mix-up and then La Real did score, in the 62nd minute, as Juanmi slid to connect with Mikel Merino's brilliant through ball.
But in the 64th minute, Barca were ahead again as Messi weaved one way and then the other before finding Alba to his left. The defender jinked inside and drove a shot into the far corner.
Earlier, Atletico Madrid had needed Thomas Lemar to come off the bench and find an 85th-minute winner against Eibar as they stretched their lead over Real Madrid to seven points.
Without Antoine Griezmann and Diego Costa, who were both suspended, Diego Simeone's side looked set for a stalemate that would have given Real at least a sniff of second place.
Instead Lemar, on as a substitute, tucked in Koke's cross to deliver another timely boost to Atleti's morale, in the same week their star goalkeeper Jan Oblak extended his contract with the club until 2023.
Lemar's goal will have done the Frenchman's confidence no harm either, after a difficult debut season following his 60 million-euro move from Monaco last summer. Simeone will expect more next term.