City will now cross town to face arch rivals Manchester United buoyed by their status as Premier League leaders and after winning in Europe's elite club competition for the first time.
Roberto Mancini's men were not at their most potent against the Spanish side at the Etihad Stadium but completed their comeback from a goal down by snatching a 2-1 win with a stoppage-time Sergio Aguero winner.
Barry said: "A last-minute goal can lift everyone - it is a massive confidence booster.
"We will just go into Sunday's game, knowing it is a massive one, with a little bit more confidence.
"But it is not a place you can go and relax - we have got to go and play our best game of the season to get something out of it.
"We respect Manchester United and hopefully it will be a good game."
The derby is being billed as the game of the season so far with both clubs having made outstanding starts.
Both are still unbeaten but it is City who just have their noses in front at the moment, leading their neighbours by two points.
City have won seven of their eight games and scored 27 goals while United are just behind them with six wins and 25 goals.
City's form in Europe, however, has been in marked contrast with a draw against Napoli and a loss to Bayern Munich in their opening two Group A games followed by another indifferent performance on Tuesday night.
Villarreal struck first through Cani at the Etihad Stadium and defended resolutely until Carlos Marchena diverted the ball into his own goal for an equaliser.
The hosts were still unable to find a spark and it looked like being another night of frustration until substitute Aguero intervened with 93 minutes on the clock.
That goal changed the complexion of the group and, although still third, City are just three points behind leaders Bayern at the halfway point.
Barry said: "We knew we really had to get the three points.
"We fought right to the end and you can't really beat a last-minute winner, so it was a good feeling in the dressing room.
"It was similar to when we played Napoli at home. They are good in possession and counter attack quickly.
"We are still learning in the Champions League and it is such a tough group.
"This has lifted everyone. We knew three points were vital to go on and qualify from the group but this is just the start.
"It is a massive lift but we have just got to build on it."
Barry was involved in another controversial City substitution - three weeks after the infamous Carlos Tevez incident in Munich - as he was sent on for Adam Johnson after just 40 minutes.
Johnson was unhappy with Mancini's tactical decision and shook his head as he left the field but, just three minutes later, Barry was involved in the build-up to the equaliser.
England midfielder Barry, 30, said: "It was a surprise but I was warming up for a while in the first half so I knew the manager was maybe thinking of making a change.
"I went on and it was important we scored just before half-time."