Lee Jarvis was the hero for the Dragons as he kicked two late penalties to clinch a vital away victory that keeps the Newport-based side right in the hunt for the Celtic League title.
This triumph at Meadowbank means the Dragons are two points off the Scarlets at the top and a mere one point behind second placed Ulster, who have a game in hand.
The Welshmen took the lead in the first-half with a try by lock Peter Sidoli that Percy Montgomery converted. The ex-Springbok legend also added two penalties to give the visitors' a 13-6 interval lead over two penalties by one of Edinburgh's six returning Scottish internationals, Brendan Laney.
There was a dramatic start to the second half action when Irish referee Alan Lewis was forced to quit the action with a leg problem and had to be replaced by Biggar official Ian Heard.
Edinburgh found their rhythm in the second half and looked like giving themselves a huge psychological boost the week before their Heineken Cup quarter-final in Toulouse when Simon Webster crossed for a try and Laney added two more penalties to give them a 16-15 lead.
But some late indiscretions cost them dear after Jarvis had entered the action and the former Wales outside half kicked two late penalties to keep alive the dream of newly appointed Wales coach Mike Ruddock of leaving the club scene with a title in his hands.