Media playback is not supported on this device
Carl Meyer, Sam Hobbs and Angus O'Brien crossed in a ten-minute first-half purple patch, with O'Brien's boot making it 24-12 at the break.
Edinburgh's Nasi Manu and Chris Dean got first-half tries and Viliame Mata's late score made it close.
O'Brien's 78th-minute penalty sealed the win to ensure the visitors are only above Zebre and Treviso in the table.
Edinburgh's snappy early handling paid off in the 10th minute as number eight Manu took advantage of a huge overlap following a break by wing Mike Allen, Jason Tovey converting against his former team.
But O'Brien quickly pulled back a penalty, and converted after Carl Meyer tore through from 30 metres following a comedy steal by hooker Thomas Rhys Thomas from the back of an Edinburgh maul.
Prop Hobbs crashed over from close range with O'Brien again converting, but moments later Dean finished off another fluid move from the visitors' back-line.
Then O'Brien made it four tries in 10 minutes, setting up the score, finishing it off from Sam Beard's kick through and adding the extras after 27 minutes.
It took a further 37 minutes for the next score to arrive, with both head coaches making a string of replacements to try to break the deadlock.
Phil Burleigh came close after a Blair Kinghorn break, but giant replacement Mata, an Olympic Gold medallist with Fiji sevens, rumbled over with Duncan Weir's conversion setting up a tense finale.
Tyler Morgan's break almost allowed the Dragons to hit back only for Damian Hoyland to pull off a vital interception, before the roles were reversed at the other end as Morgan intercepted from Hoyland.
O'Brien sent over the late penalty to earn the Dragons' fourth successive home win in all competitions, leaving an enterprising Edinburgh side to travel home pointless despite sharing the six tries.
Dragons flanker Ollie Griffiths was named man of the match.
Newport Gwent Dragons: Carl Meyer; Pat Howard, Sam Beard, Jack Dixon, Ashton Hewitt; Angus O'Brien, Tavis Knoyle; Sam Hobbs, Thomas Rhys Thomas, Brok Harris, Nick Crosswell, Matthew Screech, Lewis Evans (capt), Ollie Griffiths, Ed Jackson.
Replacements: Rhys Buckley, Phil Price, Lloyd Fairbrother, James Thomas, Nic Cudd, Sarel Pretorius, Geraint Rhys Jones, Tyler Morgan.
Edinburgh: Blair Kinghorn; Damien Hoyland, Chris Dean, Phil Burleigh, Michael Allen; Jason Tovey, Sean Kennedy; Jack Cosgrove, Neil Cochrane (capt), Murray McCallum, Fraser McKenzie, Ben Toolis, Magnus Bradbury, Jamie Ritchie, Nasi Manu.
Replacements: Stuart McInally, Kyle Whyte, Felipe Arregui, Lewis Carmichael, Viliame Mata, Sam Hidalgo-Clyne, Duncan Weir, Glenn Bryce.
Referee: Frank Murphy (IRFU)
Assistant referees: Leo Colgan (IRFU), Rhys Thomas (WRU)
Citing commissioner: Paul Thomas (WRU)
TMO: Brian MacNeice (IRFU)
Newport Gwent Dragons held on against Edinburgh to move up to ninth in the table.