Luis Enrique's men had looked distinctly out of sorts at El Madrigal until the teenager's 82nd-minute goal, failing to zip the ball around in their usual manner.
They struggled to get too many sights of Villarreal's goal and only the woodwork meant they were not behind.
Sandro - the 19-year-old academy graduate - ensured they went home with the spoils, though, tapping in a cross from Lionel Messi who was frustrated by the Villarreal defence all night.
Barca's struggles were perhaps owing to Xavi and Andres Iniesta being on the bench, but despite that they did their best to get on the ball early on and enjoyed some early play, with Messi fizzing a shot in which Sergio Asenjo saved.
There were new combinations for Villarreal to deal with in the absence of Barca's tried, tested and trusted duo, with Ivan Rakitic one of them. The former Sevilla man drifted in and shot over, and then helped the ball on as Messi had another shot turned away.
The Argentina international then whipped in a free-kick from the right channel which caught Asenjo cold, going down his narrow left side, but the ball hit the post and bounced up in time for him to turn it behind.
Villarreal laboured to create chances of their own but after the break they were nearly ahead.
Ruben Cani put a cross in and Barca's new centre-half, Jeremy Mathieu, diverted the ball against his own post as he ran back to clear.
Shaken by the close shave the away side stepped it up and Messi combined well with Pedro to get Rakitic away. He was caught in two minds as to whether or not he should shoot or cross, and in the end opted for a hybrid of the two which was cleared.
Mathieu, at the right end of the field, then found himself free at a corner but as he tried to make something of it, Victor Ruiz threw himself in front of the ball and got it clear with a brilliant tackle.
Neymar was sent on to try and pep Barcelona up but all he did was find the back of the stand with a wild swing at a cross from the right, and he was nearly made to pay as the Yellow Submarine stormed down the other end and hit the post again with Pina's crisp shot across the face of the goal.
That would not get any closer and, eight minutes from the end, Barca cracked them.
Messi got into the penalty box on the right and, after drawing Asenjo to try and narrow the angle, scuffed a cross underneath him which Sandro bundled in.