Barca's grip on the title had slipped with back-to-back draws and bitter rivals Real Madrid moved seven points clear at the top with a win at Athletic Bilbao earlier in the day, but the champions responded at Estadio de la Ceramica.
An early Pau Torres own goal put Barca in front and the mercurial Messi set up sensational strikes from Luis Suarez and Griezmann after the in-form Gerard Moreno equalized, with Ansu Fati adding a fourth late on.
Griezmann had gone eight games without a goal, but silenced his critics with a moment of class in a breathtaking attacking display from Barca, with Messi – who had a goal disallowed and hit the crossbar – starring at the end of a week in which his future has been the subject of more speculation.
Previously in-form Villarreal have still not beaten the Catalan giants since 2008 and their first defeat since the season restarted is a blow to their bid for a Champions League spot.
Barca made a blistering start and they were rewarded when Torres turned the ball into his own net just three minutes in with Griezmann waiting to pounce on Jordi Alba's cross behind him.
The Blaugrana were causing the home side all sorts of problems going forward but looked vulnerable on the break and Moreno levelled clinically against the run of play with 14 minutes played after Marc-Andre ter Stegen palmed away Santi Cazorla's strike.
Barca wasted little time in regaining the lead, though, Messi running from just inside the Villarreal half and beating two players before finding Suarez, who picked out the far corner with a sublime first-time finish from the edge of the penalty area.
Arturo Vidal and Suarez came close before Griezmann added a third just before half-time, lobbing Sergio Asenjo with a superb effort after Messi set him up with a cheeky backheel following another penetrating run.
The busy Asenjo denied Suarez and Vidal after the break and Messi had a goal chalked off after VAR ruled he had been offside before tucking in Sergi Roberto's cutback.
Fati came off the bench to put the icing on the cake, cutting in from the left to fire home and Messi rattled the crossbar with a free-kick before Asenjo superbly saved Martin Braithwaite's header following up.
What does it mean? Relief for Setien
Barca boss Quique Setien has come under fire, but his players appear to be behind him on the evidence of this performance.
On a day when it was revealed Xavi, linked with the Barca hotseat, will stay at Al-Sadd, the defending champions showed they will not give up their title without a fight with four games to play.
Messi magic, Griezmann shows his class
Griezmann has had a tough first season at Barca, but he showed what he is capable of with the finish of a player who is anything but short of confidence.
It was Messi who was the star of the show, though, yet again, slipping away from defenders with ease and laying on two goals with sheer brilliance and not looking like a man eager to leave Camp Nou.
Semedo all at sea
Barca full-back Nelson Semedo looked vulnerable defensively in the first half and was hooked off early in the second. Setien's men were too open at the back in the first half and Semedo was caught out too often.
Barca host lowly Espanyol in a derby clash on Wednesday, with Villarreal facing a tricky trip to sixth-placed Getafe on the same evening.