The former Sevilla centre-back broke through on the stroke of half-time as Barca re-established a nine-point advantage over Atletico Madrid at the summit.
Ernesto Valverde's side was once again not at its fluent best but stepped up when required, Jordi Alba netting the 64th-minute winner as an instant response to Juanmi's equaliser for Imanol Alguacil's visitors.
If Barca wins at Deportivo Alaves this week and Atleti does not against Valencia, the former will be crowned champion with four games to play.
Lionel Messi drew an early booking from La Real midfielder Mikel Merino and rippled the top of the netting with a 27th-minute free-kick.
Barca was indebted to goalkeeper Marc-Andre ter Stegen for a fabulous stop at close quarters from Juanmi, with Willian Jose blazing the rebound over.
Ter Stegen's opposite number Geronimo Rulli got down to his right to sharply deny Luis Suarez but had no chance when Lenglet peeled into space and superbly diverted Ousmane Dembele's corner into the net.
Valverde responded to Barca's sluggish resumption by sending on Sergio Busquets for Arthur, while Messi and Arturo Vidal combined for Dembele to sidefoot narrowly wide before the hour.
But the equaliser La Real deserved arrived in the 62nd minute, with Juanmi sliding Merino's delightful throughball past Ter Stegen.
Parity was short-lived as Alba cut inside and let fly with his weaker right foot, the goal surviving a VAR )video assistant referee) review after Dembele was deemed not to be interfering with play in an offside position.
Ivan Rakitic could have given Barca breathing space when he clattered into the side netting 11 minutes from time, by which point Sociedad's best work was behind them.