The Spaniard struck twice from the spot to ensure Dick Advocaat's men kept themselves alive in the battle to avoid the drop, with James Ward-Prowse dismissed for the visitors
Having seen Leicester City beat Newcastle United 3-0 earlier in the day, Sunderland needed maximum points in their penultimate home game of the season at the Stadium of Light on Saturday to avoid being cut adrift in the bottom three.
And they were given a helping hand thanks to some haphazard defending from Southampton in a game that stood in stark contrast to the 8-0 hammering Sunderland suffered at St Mary's Stadium in the reverse fixture in October.
Gomez opened the scoring for Dick Advocaat's men in the 21st minute with a coolly converted spot-kick following Jose Fonte's foul on Danny Graham.
Sunderland had barely finished celebrating when Sadio Mane took advantage of a calamitous defensive error less than two minutes later.
However, the home side were given another lifeline as James Ward-Prowse was sent off for bringing down Jermain Defoe, with midfielder Gomez stepping up to score a 55th-minute winner and move the Wearsiders to within a point of safety.
A seemingly innocuous long ball forward gave Gomez the opportunity to put Sunderland in front as Fonte felled Graham after Maya Yoshida had failed to clear.
Gomez stepped up and slotted the ball into the bottom-right corner, but the lead lasted just 78 seconds, Mane capitalising on a breakdown in communication in the Sunderland defence.
Costel Pantilimon collided with Sebastian Coates and John O'Shea as he came to collect Fonte's ball forward and Mane made no mistake in pouncing on the goalkeeper's fumble and tucking into the empty net.
Things then got worse for Sunderland when captain O'Shea - who had received treatment following an earlier collision with Shane Long - came off with an injury to be replaced by Santiago Vergini.
Yet Sunderland saw a great chance to retake the lead go begging, Connor Wickham firing over the crossbar at the end of a well-worked attacking move down the left flank.
The hosts were denied the opportunity to go into the break with their advantage restored after Kelvin Davis produced a fine finger-tip save to keep out Defoe's point-blank header.
But nine minutes after the restart the game took a major swing in Sunderland's favour when Ward-Prowse bundled Defoe over as the striker attempted to race onto Graham's lay-off.
Referee Mike Jones showed no hesitation in brandishing the red card and Gomez again kept his cool from the spot with a confidently taken penalty.
Mane then limped off and was replaced by Eljero Elia in another blow to Southampton's hopes of a top-six finish on a disappointing day for the south-coast club.
Southampton never threatened a late equaliser, but the win for Leicester and Aston Villa's 3-2 success against Everton mean that Sunderland still have plenty of work to do in a tight battle against the drop.