Barca – who had taken just one point from their previous two league games – were far from their best against their lowly opponents and were indebted to Pique's second league goal of the season for a 36th-minute lead.
Ernesto Valverde's were insipid in the second half, but did score a second three minutes from time as substitute Alena latched onto Lionel Messi's pass to clip over Sergio Asenjo for his first LaLiga goal.
Despite Barca's early dominance, Villarreal almost snatched the lead after 13 minutes when Gerard Moreno crashed against the post following sloppy defending from Clement Lenglet.
Ivan Rakitic and Ousmane Dembele came close for the hosts, who finally went ahead nine minutes before the interval when the latter's cross was headed in by Pique from eight yards.
Messi was denied a second soon after when Asenjo pawed away his close-range effort.
Santi Cazorla whipped a free-kick over the crossbar after 69 minutes as the visitors looked to find a way back into the game.
Philippe Coutinho curled a trademark effort narrowly wide before Alena raced clear in the 87th minute to coolly steer over the onrushing Asenjo and add undeserved gloss to the scoreline.
What does it mean? Barcelona do just enough
It was not pretty but, given their last LaLiga home game ended in a shock 4-3 defeat to Real Betis, Valverde will be relieved to have come through this test unscathed. Villarreal, meanwhile, have won just three times in the top flight this season and remain in 17th, a place outside the relegation zone.
The young Frenchman has been in the spotlight for the wrong reasons recently but showed why he is worth the hassle with a bright display. He bamboozled the Villarreal defence with an array of tricks and flicks and teed up Pique's winner with a fine cross.
Coutinho fluffs his lines
With Luis Suarez sidelined through injury, Coutinho was expected to contribute to Barca's goal threat. The Brazilian was entirely overshadowed by Demeble, though, in a performance characterised by poor decision-making.
Key Opta facts:
- This was Ernesto Valverde's 400th game as a manager in LaLiga (W183 D99 L118). He is the second manager to reach this milestone in the 21st century, after Joaquin Caparros (499).
- Only Real Madrid captain Sergio Ramos (five) has scored more goals than Gerard Pique (four) this season in all competitions among LaLiga defenders.
- Barcelona have kept a clean sheet in a LaLiga game for the first time since August 25 - Real Valladolid were the opponents on that occasion.
- Lionel Messi has provided more assists than any other LaLiga player this season in all competitions (nine).
- Carles Alena scored his second goal for Barcelona in all competitions (10 appearances) and his first in the league.
Both sides have home Copa del Rey second legs on Wednesday with Barcelona taking on Cultural Leonesa and Villarreal hosting Almeria.