Brendan Laney's penalty deep in injury time left the Dragons stunned at Rodney Parade and ended the Welsh side's unbeaten Celtic League home record.
Dragons (6) 16
Pens: Warlow (3)
Edinburgh (0) 17
Tries: Lee, Callam
Cons: Laney (2)
Two quick-fire tries from Derrick Lee and David Callam had given the visitors a surprise one point lead late on.
The Dragons, who managed a try from Jason Forster, looked to have salvaged victory thanks to Craig Warlow's third penalty five minutes from time.
But with 88 minutes on the clock, Laney landed a superb 50-metre kick.
The fly-half had missed two easier attempts in a hugely forgettable first half, Warlow's two successful attempts the only instances of note.
The Dragons enjoyed the better of possession, but lacked any spark or imagination to pierce Edinburgh's organised defence.
Home prop Chris Anthony came closest to scoring the first try, but the former Wales international was penalised for a knock on as he stretched for the line five minutes before the interval.
Edinburgh were a man down at that stage after prop Craig Smith was sent to the sin bin for some persistent offending.
The Dragons, though, made little of their numerical advantage.
Todd Blackadder's yellow card six minutes into the second half gave the Dragons another ten minutes with an extra man one, and this time they took instant advantage.
Ian Gough won line-out ball close to the visitors' tryline and flanker Forster broke off from the driving maul to stretch over for the score.
Warlow's conversion gave the Dragons a 13-point lead.
But just when the Dragons looked to be cruising, full-back Lee scored for Edinburgh.
Warlow lost possession in midfield and the visitors broke quickly with Rob Dewey being hauled back in the left corner by a superb covering tackle by Dragons full-back Kevin Morgan.
The visitors kept possession, though, and Lee had a free run to the line after Laney had spread the play.
Laney's conversion put Edinburgh within a converted score of the Dragons, and the Scottish side needed less than 10 minutes to wipe out that deficit.
With their tails up, Edinburgh went through a series of phases in midfield and suddenly number eight Callam found a huge gap to run in under the posts.
Laney added the extra points and Edinburgh were a point ahead in a game they never looked like winning.
The Edinburgh forwards had been testing the patience of the referee all night, and another piece of indiscipline looked like costing them the game.
Warlow made no mistake from the resulting penalty in front of the post.
But just as the home fans were ready to celebrate another home win, the Dragons were penalised for offside and Laney sent the ball sailing between the posts to snatch an unlikely win for Edinburgh.
Dragons: K Morgan; G Wyatt, S Winn, S Tuipulotu, B Brew; C Warlow, G Baber; R Snow, J Richards, C Anthony, I Gough, P Sidoli, J Ringer, J Forster (capt), R Bryan.
Replacements: K Crawford, A Black, R Thomas, R Beattie, R Oakley, B Breeze, J Bryant.
Edinburgh: D Lee; C Joiner, M Di Rollo, P Boston, S Webster; B Laney, R Lawson; C Smith, A Kelly, J Brannigan, F Pringle, A Kellock, T Blackadder, D Callam, S Cross.
Replacements: D Hall, A Dickinson, A Strokosch, A MacDonald, J Blackwood, P Godman, R Dewey.
Referee: Colin Stanley (Ireland)