Edinburgh head coach Richard Cockerill described the last-gasp victory over Glasgow as one of the highlights of his rugby career.
Cockerill's side had already conceded a Huw Jones try when they lost prop Simon Berghan to a red card for catching Scotland teammate Fraser Brown with a boot to the head in a ruck.
But Edinburgh came back from 17-6 down to seal four Guinness PRO14 points and the advantage in the three-game 1872 Cup series as Chris Dean's last-minute try handed them an 18-17 victory at BT Murrayfield.
It was a ninth victory in 10 games for Edinburgh while Glasgow suffered their first PRO14 defeat of the season.
Former England international and Leicester head coach Cockerill said: "It's up there with anything I've ever been involved with. Firstly, the players deserve the credit because they played exceptionally well under some adversity. We've tried to become tougher to play against and I think we showed that.
"We stayed in the battle, and if you stay in the battle you have opportunities to win the game. Thankfully we did so. It wasn't a pretty game, but I'm so delighted with the effort, spirit and passion that the players showed."
Warriors were left to wonder how they let the win squirm from their grasp but they have the opportunity to atone for the defeat when they host their rivals at Scotstoun next Saturday.
Head coach Dave Rennie said: "We didn't look after the ball and we weren't clinical enough. With 10 minutes to go we left the door open for them and they took it. We're not happy, but we have a chance for redemption in seven days."
Jones added: "We left a lot of points out there. We weren't good enough but hopefully we can put things right next weekend."