Ballymena ended a run of five straight defeats with victory over the Swifts in the League Cup quarter-final.
Tony Kane rifled in the opener for United and Neal Gawley finished a fine move to make it 2-0 at the Showgrounds.
Dungannon pulled one back before the break with Ryan Harpur's penalty after a foul on Andrew Mitchell.
The visitors pressed for an equaliser and David Armstrong headed against the bar before Darren Boyce fired in on 82 minutes to seal a place in the semis.
Matthew Tipton provided the lay-off for Kane to drill into the bottom corner after 21 minutes.
United were on top in the first half and David Cushley saw his shot cleared off the line by Douglas Wilson before keeper Andy Coleman saved from Tipton's header.
Allan Jenkins started the move for Ballymena's second goal on 33 minutes with a pinpoint pass to Kane, whose cross was tucked away by Gawley from eight yards.
Dungannon halved the deficit four minutes before half-time when Harpur converted from 12 yards after Mark Surgenor's foul on Mitchell.
The Swifts may be struggling near the bottom of the Premiership, with just two wins in their last 15 games, but they took the game to United in the second half.
Mitchell, Harpur and Matt Hazley went close before Armstrong was denied by the woodwork.
But their efforts were in vain as former Swifts forward Boyce came off the bench to make it 3-1 by blasting in from 18 yards.