A stunning overhead kick from veteran substitute striker Aritz Aduriz in the 89th minute snatched all three points for the home side in the opening Spanish top-flight match of 2019-20.
Barca hit the post through Luis Suarez - who went off injured in the first half with a muscle injury - and replacement Rafinha struck the crossbar, but they were largely lacklustre in attack without captain Lionel Messi, who is sidelined with a calf problem.
The result is likely to see pressure again begin to mount on head coach Ernesto Valverde, who came under fire at the end of last season for Barca's Champions League capitulation against Liverpool, as well as the Copa del Rey final loss to Valencia, although they retained the league title.
While he accepted the defeat, Pique did not believe Barca were especially poor and stressed losing at this stage of the season could in fact prove to be useful.
"San Mames is always very difficult and today the competition put us in our place," he told Movistar.
"We weren't ourselves. From the start, they pressed us a lot and physically they were better, although in the second half they dropped off a little.
"In the end, winning or losing comes down to details, and we leave with a defeat that will be good for us, because it's better to lose now than at the end of the season.
"We came from pre-season, there are new people... sometimes, you prepare for a game in one way and it doesn't happen as you expected.
"In the first half, they had one clear chance, [Inaki] Williams' one, and we had Luis hit the post.
"We played more in our own half, but that's what you expect at San Mames. In the second half, we played more in their half, but details are details and one killed us in the end."
Barcelona's next match will come at home to Real Betis before the defending La Liga champions face another road match with a trip to Osasuna.