Toulouse missed out on hosting a Heineken Cup quarter-final after they were beaten 21-16 by Wasps at Adams Park on Sunday.
The reigning champions had Florian Fritz sent off in the second half but still looked set to escape with a draw when the scores were level in the final minute.
However David Lemi had other ideas, getting on the end of a loose ball before it ran dead to clinch Wasps a place in the last eight of the Amlin Challenge Cup.
While they will now make the short trip to London rivals Harlequins next, Toulouse have to face up to a tough away day at fellow Top 14 heavyweights Biarritz in what is a repeat of last year's all-French final.
All this came after an opening quarter that had seen Toulouse take complete control.
David Skrela had already missed a penalty by the time Yannick Jauzion broke the deadlock in the 11th minute with a try that was gifted to him by some sloppy Wasps tackling.
An offload by Clément Poitrenaud, who released the ball quickly after claiming an up-and-under, sent the centre scampering away, though he should have been stopped by the combination of Mark van Gisbergen and Ben Jacobs.
The conversion was successful from Skrela but the number 10 was unable to slot over a long-range penalty as points continued to go begging.
Wasps eventually responded from the initial onslaught with a penalty from Dave Walder before the game was turned on its head by a yellow card.
Toulouse's Louis Picamoles was sent to the sin bin by referee Alain Rolland and then had to watch on from the sideline as his team-mates leaked 10 points in his absence.
It did not take long for the home side to make the most of their numerical advantage; 10 phases through the forwards from the resulting penalty led to Richard Haughton touching down not long after replacing van Gisbergen.
The former Saracens winger came back on the angle to accept scrum-half Joe Simpson's delayed pass back on the inside and race over.
Walder converted to give the home side an unlikely lead with 35 minutes gone and a further penalty from their fly-half sent them in to the break five points in front.
Any thoughts Toulouse had of launching a second-half onslaught, particularly with Picamoles' return to the field, disappeared seven minutes after the restart when Fritz was given his marching orders.
The centre was shown a red card for a spear tackle on Wasps winger Tom Varndell, leaving his side to play over half an hour with only 14 men.
Walder kicked the resulting penalty to make it 16-7 - only for the hosts to give the three points straight back when they foolishly tried to attack from deep.
Skrela kicked a further two penalties to bring the scores level, the second of which came after Serge Betsen had been sin-binned when Roland finally ran out of patience with the flanker going off his feet at rucks.
Toulouse twice attempted, and failed, drop goals to put themselves in front, but seemed satisfied with a draw as time ticked away. Lemi had other ideas, though, kicking over the top and then beating Nicolas Vergallo to the ball.
Tries: Haughton, Lemi
Pens: Walder 3
Pens: Skrela 3
Wasps: 15 Mark van Gisbergen, 14 Tom Varndell, 13 Ben Jacobs, 12 Dom Waldouck, 11 David Lemi, 10 Dave Walder, 9 Joe Simpson, 8 Andy Powell, 7 Serge Betsen, 6 Joe Worsley, 5 Richard Birkett, 4 Simon Shaw, 3 Zak Taulafo, 2 Tom Lindsay, 1 Tim Payne.
Replacements: 16 Joe Ward, 17 Charlie Beech, 18 Ben Broster, 19 Marty Veale, 20 James Cannon, 21 Nic Berry, 22 Riki Flutey, 23 Richard Haughton.
Toulouse:15 Clément Poitrenaud, 14 Vincent Clerc, 13 Florian Fritz, 12 Yannick Jauzion, 11 Maxime Medard, 10 David Skrela, 9 Jean-Marc Doussain, 8 Louis Picamoles , 7 Thierry Dusautoir, 6 Yannick Nyanga, 5 Patricio Albacete, 4 Yoann Maestri, 3 Census Johnston, 2 William Servat, 1 Daan Human.
Replacements:16 Virgile Lacombe, 17 Jean-Baptiste Poux, 18 Yohan Montes, 19 Grégory Lamboley, 20 Nicolas Vergallo, 21 Cédric Heymans, 22 Frédéric Michalak, 23 Shaun Sowerby
Referee: Alain Rolland (Ireland)