Derby secured their first away win since the opening day of the Sky Bet Championship season thanks to Tom Lawrence's late strike.
Martyn Waghorn's first-half tap-in was cancelled out by two goals in two minutes from Yan Dhanda and Kyle Naughton after the interval.
But Phillip Cocu's side rallied with goals from Duane Holmes and Wales international Lawrence to snatch only their second win on the road all season.
The hosts made two changes from the side who earned a hard-fought draw at Preston last time out.
Connor Roberts returned from a shoulder injury to slot back in at right-back, while Wayne Routledge came in for the injured Bersant Celina.
Rams manager Cocu kept faith with 10 of the players who smashed Stoke 4-0 in their last league outing, with with the only change coming up-front as Chris Martin gave way for Jason Knight.
The alteration meant Waghorn led the line for the Rams, and it took him only eight minutes to get on the scoresheet at the Liberty Stadium.
Lawrence took aim with a shot from 25 yards that forced Freddie Woodman to tip onto the post, but the rebound fell kindly to Waghorn, who tapped in his 10th goal of the season.
Swansea offered little in response during a flat first-half performance until Matt Grimes sent a free-kick into the Derby box on the stroke of half-time.
Joe Rodon rose to meet the cross but headed wide as Derby went in ahead at half-time.
But Swansea's quick-fire double ensured Derby's long wait for an away win continued.
Dhanda was brought on for the second period and made a near instant impact as the Swans levelled after 56 minutes.
The young midfielder robbed Knight of possession and drove deeper into the Rams' half before curling a low shot beyond Ben Hamer into the bottom corner.
And Cooper's side were ahead two minutes later after a moment of chaos in the Derby defence.
Hamer came out but failed to gather Andre Ayew's chipped ball in, which allowed Rhian Brewster to nip in and steal the ball away for Naughton to smash into the unguarded net.
But Swansea's lead lasted less than eight minutes as Holmes fired a half-volley past Woodman after Waghorn's knock down was only half cleared.
And the comeback was complete with 10 minutes to play as both sides pushed for a winner.
Routledge's cheap pass inside his own half was cut out by George Bird, who sprinted forward to launch a counter attack.
Waghorn took up possession and laid the ball off for Lawrence to fire a dipping shot past the motionless Woodman to earn a 3-2 win that leaves Derby only seven points off the play-offs.