Barry drove in an emphatic penalty to give Villa all three points
Aston Villa came from behind to grab a dramatic late win in a pulsating match which saw Ashley Young sent off.
Sunderland had the better of the first half and led through a Danny Collins header from a Carlos Edwards free-kick.
But Young surged down the right to cross for James Milner to bundle in the equaliser, with Sunderland claiming the ball had gone in off his arm.
Young was sent off for a diving tackle but Gareth Barry slammed in a penalty after Gabriel Agbonlahor was felled.
The victory extended Villa's unbeaten run to 10 matches but Sunderland will feel disappointed not to get a point from the match.
They pressed with purpose from the outset, but it was Villa who had an excellent opening opportunity.
Milner broke down the left and curled a delightful ball in with the outside of his right boot, but the on-rushing Young just failed to connect.
Jubilant O'Neill hails 'magnificent win'
With Martin Laursen ruled out by an injury, Carlos Cuellar was brought into the centre of defence, but Collins soared above the Spaniard to power in the opening goal.
Skipper Dean Whitehead had a chance to make it two, but having latched on to a perfectly-weighted through ball from El-Hadji Diouf, he saw his shot from an acute angle blocked by the diving Brad Friedel.
And Anton Ferdinand, whose brother Rio was watching from the stands, glanced a header narrowly wide.
Lone striker Agbonlahor looked increasingly frustrated by his team's lack of progress going forward, but he won the free-kick which led to Villa's only other chance of the half.
Following the set-piece, Young fired in a low shot from over 20 yards, but it fizzed just wide of the left-hand upright.
The home side remained a threat and Kenwyne Jones jinked through several challenges, although his weak left-footed shot was straight at Friedel.
Villa desperately needed some inspiration and once again it came from Young, who, having been freed by Agbonlahor, burst clear down the right and squared superbly for Milner, who converted in unorthodox, prostrate fashion, sliding in under challenge from Pascal Chimbonda.
With Villa pushing for a winner, Young broke free down the right again, but another inviting ball across goal evaded his colleagues.
Sbragia questions Villa equaliser
It appeared Villa's hopes of victory would be thwarted when their most creative player, Young, was shown a red card for a diving challenge on Whitehead.
The home side could have gone ahead when Djibril Cisse rose between his markers but headed straight at a grateful Friedel.
Referee Mike Dean's afternoon of controversial decisions continued when he decided substitute Paul McShane had brought down Agbonlahor inside the area.
There was no doubt about the resulting kick, as Barry smashed down the centre into the roof of the net and kept alive his side's dream of the Champions League.
The late strike continued a remarkable run for Villa, who have scored in the last 12 minutes in eight of their last nine matches.
Sunderland boss Ricky Sbragia:
"We played very well in the first-half.
"We knew they would come back at us but we conceded two bad goals. If you defend like that you don't deserve to win.
"I can't be critical of the referee, but I can be critical of my defenders for not defending it well. I thought they were poor."
Aston Villa manager Martin O'Neill:
"In the circumstances it was a magnificent win.
"I'm delighted with the way we fought back and showed fantastic determination and ability.
"I have no complaint about Ashley's challenge, if you go in two-footed off the ground it is my belief it is a red card."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.