Fiji winger Filipo Nakosi set-up the crucial try as Castres upset champions Toulouse 24-18 on Friday to reach next weekend's French Top 14 final.
Nakosi assisted full-back Julien Dumora in the final five minutes as record 21-time winners Toulouse added this semi-final defeat to May's last-four loss to Leinster in the European Champions Cup.
Castres will face Montpellier or Bordeaux-Begles, who meet on Saturday in Nice, in next Friday's final at the Stade de France in Paris.
Former New Zealand prop Charlie Faumuina returned to Toulouse's side after his three-week ban for dangerous play was reduced.
Castres head coach Pierre-Henry Broncan made three changes as in-form Kiwi No. 8 Teariki Ben-Nicholas came in for Frenchman Kevin Kornath.
The holders were quickest out of the blocks as France winger Matthis Lebel found a way through heavy Castres defence to cross after Thomas Ramos's pass.
Television footage afterwards appeared to show Lebel knock the ball on before grounding it from Nakosi's tackle but referee Ludovic Cayre chose against double-checking the effort with his video official.
Full-back Ramos and Castres fly-half Benjamin Urdapilleta traded penalties before the momentum of the half changed with a water break - enforced due to the temperature reaching almost 30 degrees celsius on the Mediterranean coast.
Toulouse's Australia lock Rory Arnold was yellow carded from the restart for a high tackle on Nakosi.
Urdapilleta made it a three-point game with a penalty five minutes later.
The Argentina playmaker added a third penalty just before half-time to make it 10-9 but only after his winger Geoffrey Palis failed to ground Urdapilleta's delicate chip kick in the in-goal area.
After the interval, Castres, from a town of just 40,000 people, took the lead for the first time as scrum-half Santiago Arata picked and went to score from short range.
The champions responded three minutes later with Romain Ntamack's try before Urdapilleta and Ramos once again had shots at goal to make it 19-18 with 10 minutes to play.
With less than three minutes left on the clock Broncan's side clinched their place in Friday's showpiece event with Nakosi's sixth assist of the season.
The former Toulon winger, 30, broke down the left and fed Dumora sublimely for the full-back to cross in the corner.
In Saturday's semi-final, France centre Arthur Vincent makes his first start since October for Montpellier after recovering from a serious knee injury.
Vincent will only have a chance of making Les Bleus' squad for next month's two Tests in Japan if his club lose this weekend with France head coach Fabien Galthie chosing against selecting Top 14 finalists.
The first Test against the Brave Blossoms takes place in Toyota on July 2.