|Castleford (18) 38|
|Tries: Dorn 2, Roberts 2, Solomona, Moors Goals: Gale 7|
|St Helens (18) 42|
|Tries: Swift 3, Percival 2, Quinlan, Makinson Goals: Walsh 7|
Adam Swift's hat-trick ended Castleford's top-four hopes and secured St Helens' place in the Super League semi-finals with two games to play.
Castleford, who trailed the champions by four points in the table at kick-off, scored six tries but found seven-try Saints too strong.
Saints move above Huddersfield Giants into third place with the win.
Cas can match the 34 points of the Giants, who play Warrington on Sunday, but have an inferior points difference.
The regular-season meeting of these two sides was won by a dramatic late drop-goal by Tigers playmaker Ben Roberts to end a 15-game losing streak against Saints.
However this time there was no such salvation.
Both sides had tries chalked off early on but Saints responded on the following play when Swift rolled his way across from a Josh Jones flick to score, and he went in again shortly after a deliciously flowing move to the left.
James Roby's break was stemmed by desperate defence but the ball was recycled by Jones, who delayed the pass to meet a beauty of a line from Mark Percival to score.
Jon Wilkin was denied a fourth try by the video referee and Cas went up the other end to score when Luke Dorn's footwork on the back of an inside ball from Luke Gale reduced the deficit.
Dorn raced in again with a step and pace that took him to eighth on the all-time Super League scorers chart and Ben Roberts scored after Luke Gale won a penalty with a teasing run across field to bring the scores level at the break.
Roberts failed to replicate his regular season heroics when he missed an attempt at the end of the half but got a second try after half-time when he took a wonderful offload from Mike McMeeken to score.
Percival shuttled in on the resulting set to grab a second although the lead swung back the home side's way when Gale sank a long-range penalty goal.
Adam Quinlan finished off out wide after Roberts spilled the restart and not even an obstruction claim could deprive Saints when the decision went to the video referee, who awarded the try.
Tommy Makinson slid in for a sixth score but Cas fought back once again when Gale's looping ball to the left found Denny Solomona to touch down.
Swift grabbed the treble when he supported a Jon Wilkin break to scoot under the sticks and once Percival had a hat-trick score ruled out by the video referee, not even a desperate late try from Junior Moors could drag Daryl Powell's side back into contention.
Castleford Tigers head coach Daryl Powell:
"We scored enough points to win the game but we couldn't defend well enough. We're disappointed we're not going to make the four. We've let ourselves down badly over the last three games.
"We've been all over the place defensively but we've played some outstanding rugby league all year and we did tonight.
"I thought there were loads of positives for us but there needs to be a bit of an attitude shift if we are to get into the top four on a regular basis."
St Helens head coach Keiron Cunningham:
"This video ref system is just becoming a mockery of rugby league. We've got referees making decisions on the field and getting them overturned. The Jon Wilkin no-try was a massive swing for us. At 24-0 it was game over.
"We've had three video-ref no tries, which absolutely baffles me. I don't get the whole system. You might as well not have a referee on the field any more, you might as well just run with a video referee for everything.
"Our start was what we wanted, it was brilliant. credit to Cas, who had everything to play for tonight, it was their final hurrah and we knew they would come out fighting. We fell into the trap of playing into Castleford's hands and it started getting like touch footie where we were missing tackles and grabbing instead of using shoulders like we did at the start."
Castleford: Dorn; Gibson, McMeeken, Shenton, Solomona; Roberts, Gale; Lynch, Milner, Millington, Holmes, Moors, Wheeldon
Interchanges: Boyle, Maher, Springer, McShane
St Helens: Quinlan; Makinson, Percival, Jones, Swift; Burns, Walsh; Amor, Roby, Walmsley, McCarthy-Scarsbrook, Wilkin, Turner
Interchanges: Richards, Greenwood, Flanagan, Thompson
Referee: Ben Thaler