Alfie Barbeary's try three minutes from time saw Wasps beat Edinburgh to reach the European Challenge Cup semi-finals.
The Premiership side trailed 30-27 with five minutes remaining when they mauled to the line and Barbeary dived over.
Tries from Ben Vellacott and Adam McBurney gave Edinburgh a half-time lead but Wasps responded with scores from Jimmy Gopperth and Biyi Alo.
Tom West put Wasps ahead but Edinburgh levelled through number eight Magnus Bradbury before Barbeary's winning try.
Wasps will now play the winners of Lyon and Glasgow for a place in the final.
The winning try was a superb effort from the forwards as their initial line-out drive was strongly repelled.
Wasps splintered off the maul, were held up just short but Barbeary's pick-and-go got over the line.
Edinburgh are left to concentrate on securing a play-off place in the United Rugby Championship.
They opened the scoring with a flowing move finished by scrum-half Vellacott in the right corner, and Grant Gilchrist's chargedown led to McBurney being mauled over for a second try.
Bradbury picked a great line to take Chris Dean's pass to break the defence and level the tie at 27-27.
The home side then went ahead with six minutes remaining as Emiliano Boffelli kicked a penalty.
But they conceded a penalty themselves directly from the restart and Wasps took full advantage.
Edinburgh: Van der Walt; Hoyland, Bennett, Dean, Boffelli; Kinghorn, Vellacott: Courtney, McBurney, Nel, Hodgson, Gilchrist (capt), Crosbie, Boyle, Bradbury.
Replacements: Harrison, Schoeman, Atalifo, Phillips, Kunavula, Pyrgos, Currie, Blain.
Wasps: Kibirige; Hougaard, Spink, Gopperth, Bassett; Atkinson, Robson; West, Oghre, Alo, Launchbury (capt), Stooke, Shields, J Willis, Barbeary.
Replacements: Frost, Harris, Millar-Mills, Gaskell, T Willis, Porter, Umaga, Odogwu.
Referee: Pierre Brousset (France)