Curtis Allen's penalty eight minutes from time gave the Bannsiders a Premiership victory at Stangmore Park.
Paul Owens put the visitors ahead on 10 minutes, finishing a slick move with a low drive into the bottom corner.
Ryan Harpur hit the crossbar before blasting in an equaliser from eight yards midway through the second half.
Michael Funston was red-carded for handball near the goal-line and Allen converted the spot-kick before the Swifts twice hit the woodwork late on.
Dungannon were dealt an early blow when Sean Friars was forced off to come off with a hamstring injury.
Owens struck after good build-up play from Stephen Lowry and former Swifts midfielder David Scullion.
Allen sent a curling shot just over as the Bannsiders went in at the break with a deserved lead.
The hosts were the better side in the second half and Harpur levelled at the third attempt after hitting the crossbar and slicing over from six yards.
Funston handled from Ciaran Clarke's cross and Allen duly converted from 12 yards.
There was drama in the third and final minute of injury-time when Marc Brolly volleyed against the bar and Michael Ward hit a post from the rebound.