Previous Manchester City forward John Guidetti beat Marc-Andre ter Stegen in the wake of hustling clear to give the guests an unexpected lead.
Lionel Messi had a free-kick addressed to the post by Alaves attendant Fernando Pacheco before Luis Suarez evened out.
Messi secured the focuses for the La Liga pioneers with a heavenly free-kick.
Barcelona are 11 focuses clear of closest opponents Atletico Madrid, who won 3-0 prior on Sunday at home to Las Palmas.
Basque club Alaves, seventeenth in the table, were on course to cause a furious when Guidetti, on credit from Celta Vigo, let go his side ahead in the principal half.
Barca ruled ownership however looked set for a disappointing night.
Messi had a before free-kick touched onto the post while Paulinho had another possibility snared off the line and Coutinho, a £142m marking from Liverpool, had a shot diverted wide.
Alaves were exuberant all through and could have included a moment objective not long after subsequent to proceeding, Ruben Sobrino seeing a shot ripped at away by Ter Stegen, while Ruben Duarte was denied by Gerard Pique's square.
Suarez volleyed home subsequent to being teed up by Andres Iniesta for Barca's equalizer before Messi's splendid set-piece close to the end fixed the focuses.