Southampton had James Ward-Prowse sent off for his part in the second penalty incident but almost snatched a point with the last kick of the game, only for Costel Pantilimon to save Sunderland with a great save from sub Steven Davis.
Sunderland remain in the drop zone, Leicester having won earlier in the day, but the Black Cats are only a point from safety and have a game on most of their rivals, so hope is very much alive on Wearside.
The first game between these two clubs this season was won 8-0 by Southampton but a repeat never looked on the cards, Sunderland going about their work with a lot more vigour on this occasion.
Danny Graham was recalled in attack by the boss Dick Advocaat and he was off-target with an early half-chance after latching onto a neat pass from Billy Jones.
And the hosts took the lead in the 21st minute when Saints defender Maya Yoshida could only head a speculative long pass up into the air and Jose Fonte then sent Graham to the turf with a recklessly high challenge.
Gomez calmly tucked the spot-kick into the corner of the net but the hosts then handed Southampton an equaliser just a minute later.
Fonte’s punt forward did not look very dangerous but there was a mix-up at the back and after Pantilimon spilled the ball following a collision with Sebastian Coates, Sadio Mane was happy to sweep the ball into the unguarded net.
Undeterred by the concession of such a soft leveller, Sunderland pushed forward, eager to regain the initiative, and Jermain Defoe blazed over, while Graziano Pelle headed off-target at the other end.
Connor Wickham then squandered a fantastic chance, side-footing over the top after marauding full-back Patrick van Aanholt had picked him out with a fine low cross.
There was more frustration for Sunderland before half-time as Kelvin Davis in the Southampton goal kept the scores level, scrambling across his goal to keep out a close-range Defoe header with a fine one-handed save, and then parrying away a Sebastian Larsson free-kick.
But the hosts started the second-half in lively fashion and the turning point of the match went their way 10 minutes after the break.
Graham did really well in the box, eluding a challenge and then playing in Defoe, who was let down by his first touch but was felled by a clumsy Ward-Prowse challenge in any case.
Referee Mike Jones pointed to the spot and, while that may well have been the right call, the Southampton players were stunned that he also reached for a straight red.
Gomez was unbothered and having put his first spot-kick into the right-hand corner, he went to the left this time, successfully sending Davis the wrong way.
Despite being down to 10 men, Southampton bossed the remaining half-hour or so but struggled to create chances against a packed home defence.
Pelle appealed for a penalty when his shot seemed to hit Coates on the arm as the defender slid in to block but it would have been harsh and ref Jones was not interested.
Southampton’s best chances came late on but Vergini did well to get in the way after his fellow sub Filip Djuricic had chested the ball down in the box.
Vergini then blotted his copybook, giving the ball away in stoppage-time with a careless back-heel deep in his own territory but, when the cross came over, Pantilimon was on hand to deny Davis and Sunderland’s fans were able to breathe a huge sigh of relief.
Soccer Saturday verdict – Paul Merson
“The first one is definitely a penalty; he’s kicked his head quite high. Literally a minute later, Fonte lumps a hopeful ball into the box. Pantilimon comes to collect it and his own player completely takes him out.
“After that, there wasn’t a lot in it. Southampton weren’t their fluent selves and obviously, Sunderland were nervous towards the end, because it was a very, very big win. The second penalty is touch and go – probably a penalty but not a sending off, so the ref wasn’t that bad.
“Sunderland have got to play tough teams. It’s all about timing, these fixtures are all about what other teams have got to play for. If they’d have lost that game (today), I think they’d have been relegated.”