The victory goes some way to avenging the defeats they have suffered at this stage the past two seasons and marks their return to the semi-finals for the first time since the 2014 final loss to Toulon.
Armand Batlle was the key man, crossing either side of half-time to power his side to a second win at Stade Ernest-Wallon this season.
The winger grabbed the first of his double in the 12th minute, although Thomas Ramos quickly responded with a pair of penalties to cut the margin back to a point.
Castres steadied through three-pointers from Rory Kockott and Benjamin Urdapilleta before half-time and they were in complete command when Batlle’s second converted try in the 44th minute was followed by another Kockott penalty.
But a well-organised Castres held firm to complete the upset and keep alive hope of a first title win since 2013.