Phil Godman's drop-goal with the last move of the game kept Edinburgh's Heineken Cup hopes on track after another titanic win over Racing Metro.
The Scots were ahead for much of a game in which Ross Rennie, Netani Talei and Dave Denton scored their tries.
Francois Steyn, Juan Imhoff and Antoine Battut replied for the French.
Jonathan Wisniewski's penalty had put Racing ahead for the first time before Greig Laidlaw levelled then set up Godman for the dramatic winner.
The Scots, who had defeated Racing 48-47 at Murrayfield, went into the game sharing top spot in Pool Two with Cardiff Blues, who face London Irish on Saturday.
But Racing looked determined to gain revenge, sped into attack from the kick off and were unfortunate not to take the lead within a couple of minutes when Sebastien Chabal failed to hold in the corner after a swift passing movement along the line.
Steyn also missed a long-range kick after the Scots were ruled offside.
Edinburgh steadied themselves and were also dangerous on the counter-attack, winning a penalty of their own after a good Laidlaw kick.
However, the man who had been switched from scrum-half to fly-half to make way for the returning Mike Blair slid his penalty attempt the wrong side of the posts from just inside the Racing half.
The visitors eventually went ahead after 14 minutes, when Rennie saw an inch of daylight then powered through the space and a couple of tackles to score under the posts, with Laidlaw adding the two points.
Racing squandered another opportunity in the corner before eventually breaking through for a try after 24 minutes, Fabrice Estebanez ending a period of pressure by setting up Steyn to breach the Edinburgh line and touch down under the posts.
A simple conversion from Fernandez levelled the scores, but Edinburgh responded and, after rejecting one opportunity to settle for a kick, Talei twisted and turned superbly before reaching out a telescopic arm to touch down.
Laidlaw's conversion had the visitors 14-7 ahead after 28 minutes and, although Racing exerted pressure from then on until half-time, when Imhoff mishandled on the 10-metre line it ensured the Scots went into the break seven points ahead.
The Racing full-back made up for that straight after the restart when, after some early Edinburgh pressure, he broke clear down the right wing and superbly sidestepped Chris Paterson to score, with Fernandez converting.
Racing were now looking dominant as they upped the pace, but a dropped ball by Chabal gave Edinburgh the chance to reply and Denton showed amazing speed for a flanker to race 25 metres to score after a neat shimmy.
The French side refused to be knocked out of their stride and the pressure told when Battut touched down in the corner and, with Fernandez leaving the field through injury, Descons was accurate with the 58th-minute kick from the touchline.
Steyn missed with another long-range kick, but Paterson failed to hold a high ball and conceded a penalty from which Wisniewski kicked from in front of the posts to take the lead for the first time after 70 minutes.
When Roddy Grant was lifted in the tackle, Laidlaw slotted over a monster kick to level the scores once more.
Tim Visser was immediately penalised for an alleged tackle off the ball, but Wisniewski missed his penalty attempt from the touchline.
Then, with seconds ticking down, Laidlaw's pass found substitute Godman to fire between the posts, being met immediately by the final whistle.
Edinburgh coach Michael Bradley: "We got lucky at the end. We held our composure and fell over the line with Phil's drop goal.
"And, credit to him, he's put in all the hard yards in training in the last six months to get back and come on and win a game like that.
"Credit has to go to both set of players. It was a good open game of rugby, particularly in that second half.
"Racing really tore into us at the start of that period and we had to weather the storm, but we got there in the end.
"We knew that the side that could hold onto the ball would get an opportunity in the last 10 minutes and that's what happened."
Racing Metro 92: Jose Imhoff, Vakatawa, Steyn, Estebanez, Saubade, Hernandez, Descons, Lo Cicero, Orlandi, Nallet, van der Merwe, Leo'o, Battut, Chabal, Arganese. Replacements: Vaquiin for Vakatawa (74), Wisniewski for Hernandez (57), Loree for Descons (71), Sa for Orlandi (50), Le Roux for Chabal (65), Bianchin for Arganese (65). Not Used: Chavancy, Ben Arous.
Edinburgh: Paterson, Jones, De Luca, Scott, Visser, Laidlaw, M. Blair, Jacobsen, Ford, Cross, Gilchrist, Cox, Denton, Rennie, Talei. Replacements: T. Brown for Paterson (70), Godman for M. Blair (67), Gilding for Cross (67), Grant for Rennie (49). Not Used: Walker, Traynor, Lozada, Thompson.