Centre Tyler Morgan grabbed a superb try double but a second half surge from Edinburgh Rugby saw the Scots claim Guinness PRO14 victory at BT Murrayfield.
Wales international Morgan twice crossed the whitewash in the first half to cancel out scores from opposite number James Johnstone as battling Dragons took a slender lead into the interval in the Scottish capital.
Dragons were still level on the hour after a display packed full of desire and commitment, particularly in defence where they frustrated the hosts for long periods.
However, late scores from Magnus Bradbury and a Duhan van der Merwe double ensured Richard Cockerill’s side - who had not lost at home since April – claimed maximum points.
Dragons made two changes to the side that were narrowly denied at home to Munster, with Jarryd Sage and James Benjamin returning to the starting line-up, while all the Wales internationals were unavailable.
Edinburgh, by stark contrast, were buoyed by the return of several Scotland players during the Six Nations as they looked to maintain the race for a top three finish.
Edinburgh flew out of the traps in the opening minutes, but welld-drilled Dragons held firm and then forced the first real opportunity of the game after Josh Lewis kicked deep to the corner.
The forwards smashed up to the line with Harri Keddie, Ollie Griffiths and Joe Davies all carrying strongly before Sage and Lloyd Fairbrother were inches from the whitewash before Edinburgh forced a crucial penalty.
Dragons were made to pay for not taking the early chance as the Scots struck with Chris Dean making the initial break before centre partner Johnstone skipped past two men to score.
But, within three minutes, back roared the Dragons as Jordan Williams drew two tacklers and freed Benjamin who combined with Talbot-Davies to send Morgan over in the left-hand corner. Lewis added the extras from the touchline to tie the game.
Edinburgh certainly looked in the mood with ball in hand and grabbed a second with Johnstone the man to go over again after a slick backs move cut Dragons open.
However, within four minutes the home side were guilty of a stray pass deep in their own half and the alert Morgan chose the perfect moment to pick off Dean’s error and race over unopposed to level the game once more.
Fly half Lewis nudged Dragons ahead for the first time, after Rhodri Williams was tackled in the air as he took a high ball, before Edinburgh turned to their forwards with two five-metre lineouts.
But brilliant work from Keddie, in the shadow of his own posts, forced a penalty and then Griffiths swooped on the stroke of half-time with a trademark turnover as Dragons led 17-14 at half-time.
Talbot-Davies showed great pace and desire at the start of the second half to get back and deny wing Darcy Graham after he hacked ahead into space.
The wing then showed a clean pair of heels to his opposite number as Dragons continue to go blow for blow and dig deep to repel mounting home pressure.
Lewis saw a long range penalty attempt drop wide left before Jaco van der Walt slotted a kick of his own from in front of the posts after Dragons were pinged offside.
Edinburgh were now looking to their power game in the set piece for dominance and two quick-fire scrum penalties forced more territory and possession.
The pressure finally told when a series of pick and goes were finished off by back row Magnus Bradbury by the posts and van der Walt sent the home side 24-17 ahead with just over 15 minutes left.
The Scots then moved clear when van der Merwe was tackled close to the touchline but amazingly rolled out and stayed in field to skip down the touchline to score.
And the prolific wide man had the final word two minutes from time as Edinburgh wore Dragons down and exploited an overlap to send him over.
08m Johnstone t van der Walt c 7-0
11m Morgan t Lewis c 7-7
16m Johnstone t van de Walt c 14-7
20m Morgan t Lewis c 14-14
25m Lewis p 14-17
56m van der Walt p 17-17
63m Bradbury t van der Walt 24-17
69m van der Merwe t 29-17
78m van der Merwe t 34-17
Dragons: Jordan Williams (Kirchner 74), Jared Rosser, Tyler Morgan, Jarryd Sage (Henson 56), Will Talbot-Davies, Josh Lewis, Rhodri Williams (Davies 71); Brok Harris (Fawcett 65), Richard Hibbard (Lawrence 73), Lloyd Fairbrother (Suter 76), Joe Davies (Evans 46), Matthew Screech, Harrison Keddie, Ollie Griffiths, James Benjamin (Basham 68)
Replacements: Rhys Lawrence, Rhys Fawcett, Dan Suter, Lewis Evans, Taine Basham, Rhodri Davies, Gavin Henson, Zane Kirchner
Edinburgh Rugby: Dougie Fife, Darcy Graham, James Johnstone, Chris Dean (Socino 76), Duhan van der Merwe, Jaco van der Walt Henry Pyrgos; Pierre Schoeman (Sutherland 76), Ross Ford (Cherry 56), Pietro Ceccarelli (McCallum 65), Fraser McKenzie (Hunter-Hill 71), Ben Toolis, Magnus Bradbury, Luke Crosbie, Viliame Mata (Miller 76)
Replacements: David Cherry, Rory Sutherland, Murray McCallum, Callum Hunter-Hill, Ally Miller, Nathan Fowles, Simon Hickey, Juan Pablo Socino
Referee: Andrew Brace (IRFU,42nd competition game)