Messi shines in sparkling Barcelona Christmas stroll
Real Madrid, who drew 0-0 in Barcelona in the midweek Clasico, can draw level top on 39 points but behind on goal difference if they win at home to Atletico Bilbao on Sunday.
Seville are assured third place over Christmas on 34 points after their 2-0 win in Mallorca.
"I needed to score a goal before the holidays, now I can go into them happy with myself," said the French World Cup winner who has scored just seven goals since his summer move.
"We have a great team with some of the best players around and when we don't click, well, there's always Messi."
Messi had already had a better strike ruled out by a harsh VAR decision, while Mohican-haired Chilean forward Arturo Vidal had tried a dramatic overhead effort that the Alaves 'keeper just about stopped with his feet'.
Vidal bagged a second just before half-time when put into open space on the right as Barcelona overwhelmed the visitors, but they should have gone into the break more than 2-0 ahead.
Pere Pons pulled one back on 56 minute for Alaves with neither Gerard Pique nor the returning Samuel Umtiti on hand as his header flew home from close range.
Even with four defenders around him, Messi was unstopabble on 69 minutes as he unleashed a trademark left foot strike from outside the box.
The goal illustrated why the diminutive attacker recently won a sixth Ballon d'Or.
A sweetly-struck Luis Suarez penalty made it 4-1 on 75 minutes.