The champions were without captain Sergio Ramos and star striker Karim Benzema due to injury but were in front after just 107 seconds through Mariano Diaz, back in the line-up for the first time in 18 months.
Mariano's previous start in May 2019 had seen him score twice in a victory over Villarreal, yet his goal - which angered Unai Emery and his players amid confusion over a potential offside - proved only enough for a point this time.
Thibaut Courtois felled Samuel Chukwueze and, after a number of close calls for a defence evidently missing Ramos, Gerard Moreno tucked away the resulting penalty to equalise, keeping Madrid fourth following their humbling at Valencia prior to the international break.
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 equalised, 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.
What's next?
Barca host lowly Espanyol in a derby clash on Wednesday, with Villarreal facing a tricky trip to sixth-placed Getafe on the same evening.
Barcelona suffered their first defeat of the season when they went down to Monaco in the Champions League in midweek, but Hansi Flick's team bounced back in style in LaLiga.
They have now won their opening six league matches under Flick to start the season.
Lewandowski found the net twice inside 35 minutes before Villarreal pulled a quick one back through Ayoze Perez.
But Pablo Torre made it 3-1 after the break and Raphinha completed the rout for Barca with two goals late in the second half.
Barcelona did, however, lose goalkeeper Marc-Andre ter Stegen just before half-time after the German goalkeeper fell and was visibly in pain as he was carried off the pitch on a stretcher.
The Blaugrana remain top of the standings as they preserved a four-point lead over defending champions Real Madrid in second.
Data Debrief: Ten in a row for free-scoring Barca
That is now 10 LaLiga wins on the spin for Barca over the course of this season and the end of last. That is their longest such winning streak since 2017, when Lionel Messi was still running the show.
Barca have now scored 23 goals in all competitions this season, a tally bettered only by Bayern Munich (29).
The Blaugrana's five goals on Sunday came from 4.08 xG, though Villarreal did have chances of their own, accumulating 2.11 xG, so Flick will want to see his team tighten up at the back.
Though their three-match winning streak in LaLiga ended, Michel's side recovered from 2-0 down to earn a share of the spoils at Estadio de la Ceramica.
Villarreal were unbeaten in five matches across all competitions, and broke the deadlock midway through the first half when Thierno Barry tucked home after Yeremy Pino's initial header came back off the post.
The hosts, who were aiming to close the gap on the top three, doubled their lead within a minute of the restart through Alex Baena.
Girona responded in the 66th minute, halving the deficit when Donny van de Beek's deflected half-volley beat Diego Conde from the edge of the box.
Christhian Stuani saw an equaliser ruled out by VAR for offside, but the visitors did ensure a share of the spoils deep into stoppage time through Krejci's volley from distance.
Data Debrief: Barry joins Yamal in exclusive group
At 2-0 up, Villarreal were on course for their seventh victory over Girona in eight meetings.
Barry broke the deadlock and became the third player born in 2002 or later to be involved in six or more goals (four goals, two assists) in LaLiga this season, after Lamine Yamal and Fabio Silva.
However, Girona fought back, and though they could not extend their winning streak, the visitors maintained their momentum by earning a point.
Goals from Alfonso Pedraza and Moi Gomez handed the seventh-placed Villarreal their first LaLiga win at Camp Nou since 2008 and punctuated Barcelona's trophy-less season, finishing 13 points off the title-winning Real Madrid.
The fact Barca even finished second provided some cause for satisfaction given their start to the season, after winning only four of the opening 13 league games and sitting ninth in November, when Xavi took over from Ronald Koeman.
The 42-year-old believes, amid an expectant fan base, the time to get to work and transform the squad to his liking has officially come, now Barca have reached the end of the season.
"I keep the minutes in which people have cheered," Xavi said post-game. "It is normal, the public does not like to lose. But taking stock, we have to be satisfied. We have to be humble and see reality. Now the work of the office begins.
"We have to change things. We have to opt for titles. We have to change things. We have to improve and strengthen ourselves."
After only managing Al-Sadd for two years before taking on the coaching role at his former club, Xavi has experienced a baptism by fire upon his return to Europe, with crises gripping his boyhood club both on and off the pitch.
The Blaugrana have experienced positive and difficult moments in his first coaching role in Europe, defeating Real Madrid 4-0 at the Santiago Bernabeu but also falling meekly in the Europa League at the hands of eventual winners Eintracht Frankfurt.
On a personal level, Xavi is in a sense satisfied he has aided Barcelona in qualifying for the Champions League and salvaging their season, but is the adamant his squad must improve.
"I knew that it was coming at a complicated and difficult moment," he said. "We have improved, but not enough. We have played brilliant games, but we have to be more reliable. I am here to add value, now we have to work for next year. We have to be positive.
"We've saved a season that could have been disastrous. I'm satisfied on a personal level. We came from one of the worst moments in the club's history. A lot of things have to be changed.
"This season has gone as it has gone. The coach has changed. And now we cannot come second. We have to reinforce ourselves very well. We have to compete. We have to change many things."