A third straight league win moves Ernesto Valverde's side clear of second-placed Atletico Madrid, but their advantage will be reduced back to one point if Alaves beat Eibar on Sunday.
Luis Suarez put the visitors ahead in the 11th minute, but Vallecano looked like they would record just their second win of the season as Jose Pozo and Alvaro Garcia netted either side of the interval.
The Catalan giants produced a stirring last-gasp comeback, though, with Ousmane Dembele drawing them level in the 87th minute and then Suarez delivering the decisive blow three minutes later.
Any hopes Vallecano had of containing their illustrious opponents – 5-1 El Clasico victors last weekend – were obliterated after just 11 minutes.
Jordi Alba latched onto Ivan Rakitic's stunning cross-field pass and pulled the ball back for Suarez to slot in his eighth league goal of the campaign from six yards.
The hosts should have drawn level just after the half-hour mark, Pozo firing wide from 10 yards after a blistering counter-attack had torn Barca's backline apart.
The former Almeria man made amends 10 minutes before the interval, however, whipping a wonderful strike in off Marc-Andre ter Stegen's left-hand post from 25 yards.
Barca came agonisingly close to restoring their advantage moments before the break when Suarez's curled effort crashed off the outside of the upright.
That near-miss was brought into sharp focus after 57 minutes when substitute Garcia powered home from close range after Raul de Tomas' header had fallen kindly to him off the post.
Vallecano were unable to hold on for a famous win, however. Dembele pulled Barca level with a crisp half-volley from Gerard Pique's headed knockdown before Suarez stole in at the back post to prod past goalkeeper Alberto Garcia for a dramatic late winner.
Barca show fighting spirit
It was not pretty, but Barcelona showed enough grit in those final stages to maintain the momentum of their stunning win over Real Madrid. It is five wins on the spin in all competitions now for Valverde's side and with Lionel Messi set to return imminently, it looks ominous for their LaLiga rivals. Vallecano, meanwhile, remain rooted in 19th after just one win all season.