Villarreal took the lead through Samuel Chukwueze’s composed finish before Griezmann equalised moments later with a quality finish.
The France forward then pounced on a poor back pass by Juan Foyth, on loan from Tottenham, to put Barca ahead.
Villarreal’s Manu Trigueros was sent off for a foul on Lionel Messi.
The result put Barcelona two points behind leaders Atletico Madrid, who are away to Athletic Bilbao in the late game on Sunday (20:00 BST).
Ronald Koeman’s side, who were 12 points off the top earlier in the season, have one game in hand on Real Madrid.
One of Barca’s remaining six league games is at home to Atletico on 8 May.