Needing to win to be sure of a trip to top seeded Saracens, the Ospreys looked to be in complete control at the break after two tries in four minutes had sent them into an 18-6 lead.
But they failed to add to their lead in the second half and ran the risk of losing out for another season as the spirited home side came storming back into contention and closed the gap to one score.
Two penalties apiece from Sebastien Laloo and James Hook were the only points of the first quarter before the expansive approach of the visitors finally earned them some reward.
An inside pass from Hook to No.8 Filo Tiatia, playing at inside centre, enabled the former All Black to make a crucial break and a quick feed from the bridgehead he formed in the home 22 allowed the ball to be spread wide to the right for Shane Williams to cross for the first try.
Hook added a wide angled conversion and four minutes later he was in action again after fullback Lee Byrne had been worked clear for a second try. This time the Welsh outside half slipped as he took the conversion and that meant the Ospreys led by 12 points at the break.
English referee Wayne Barnes denied both sides a try in the opening eight minutes of the second half – Sonny Parker lost out because of crossing and a forward pass then denied Mathieu Nicolas – and as time wore on so the home side came more and more into the reckoning.
Bourgoin’s best moment came after 51 minutes when they drove loose head prop Karina Wihongi over from a five metre line-out to cut the deficit to seven points.
From there on in it was all about the Ospreys holding Bourgoin at bay to ensure they won the game and graduated into the knock-out stages for the first time. A 69th minute penalty from Hook seemed to have steadied Welsh nerves, but with five minutes left to play Morgan Parra put the cat amongst the pigeons once again.
As Bourgoin threw everything into attack to try to claim the draw the Ospreys lost Byrne to the sin-bin for an off the ball tackle to add to the tension. But Gavin Henson intercepted a long, floated pass on half-way, reached the 22 and from the ruck Huw Bennett, Hook and Williams handled to send replacement back row forward Jonathan Thomas in for a clinching try.
There was just enough time for one final play and Bourgoin replacement fullback Florian Denos made the most of it with a chip and chase try up the right touchline. Parra converted, but it wasn’t enough to deny the Ospreys their moment of glory.