Castleford claimed their first win over Saints for seven years in the most dramatic of circumstances with full-back Ben Roberts landing a drop-goal in the last act of a pulsating clash.
Saints were on course to extend their winning run against the Tigers to 16 matches when they led 24-22 four minutes from the end.
However, Luke Gale, on the 200th appearance of his career, brought the home side level with a penalty before an off-balance Roberts broke the deadlock as the hooter sounded to clinch a remarkable 25-24 triumph.
It was Castleford’s fourth win in a row as they climbed back into top four with the aid of another notable scalp, seven days after knocking Leeds off the top of the table.
St Helens, who finished with 12 men after centre Mark Percival was sin-binned for a professional foul, stay top but will be displaced by Leeds if they beat Hull on Sunday.
It was a tremendous climax to a superb free-flowing encounter which featured tries by all four players making their comeback from lengthy injury absences.
Castleford winger Justin Carney had been out for 10 weeks with a dislocated elbow but it took him just five minutes to make considerable presence felt as the produced a trademark finish to power his way over at the corner for his 10th try of the season.
However, the Australian immediately blotted his copybook by dropping the ball from the re-start and that enabled Saints to launch a flurry of attacks on the Tigers’ line.
Jon Wilkin, restored to his customary spot in the pack, and his second-row partner Louie McCarthy-Scarsbrook both breached the line only to be turned on their backs but the pressure paid off when the returning Luke Walsh followed up a grubber kick from his half-back partner Travis Burns to score an equalising try.
Percival added the goal and Saints extended their lead on 15 minutes when prop Alex Walmsley took Walsh’s short pass to burst through the Castleford defence for their second try.
The visitors might have been further ahead but for two knock-ons from winger Adam Swift and, when passing broke down again near the Tigers tryline, winger Denny Solomona swooped on the ball and showed a clean pair of heels to his pursuers on a 95-metre sprint upfield for his eighth try in his last four appearances.
Gale added the conversion to make it 12-10 but Saints restored their eight-point advantage 10 minutes before the break when Joe Greenwood charged onto Walsh’s pass to cross for a try on his comeback.
Percival’s third goal made it 18-10 but Castleford were a rejuvenated team in the third quarter.
Roberts, revelling in his new full-back role, eluded the attempted tackle of Walsh and produced an inch-perfect kick for centre Jake Webster to collect and touch down in one glorious movement for the home side’s third try.
Gale kicked his second goal and, after second rower Oliver Holmes had turned defence into attack by collecting a kick from Burns to romp 60 metres upfield, Castleford went in front for the first time on the hour when Gale’s kick bounced back off the Saints defence to present Matt Cook with a try on his comeback.
Gale’s third goal made it 22-18 but the Tigers’ lead lasted only five minutes as the game continued to flow from end to end and full-back Shannon McDonnell won the race to Jordan Turner’s kick to go over for Saints’ fourth try.
Percival’s goal from in front of the posts restored the visitors’ lead but the drama continued, with Wilkin relieving pressure on his own line by intercepting a pass from Castleford’s former St Helens hooker Scott Moore.
The game was held for almost 10 minutes to enable Swift to receive treatment for a head injury before he was carried off on a stretcher and Saints finished the game with 12 men after Percival was sin-binned for holding down Solomona in the tackle after the winger had gone on a daring touchline dash.
Castleford opted to run the penalty with six minutes left but decided to kick for goal two minutes later when McCarthy-Scarsbrook was pulled up for a push on Roberts off the ball.
Gale stepped up to land the 40-metre penalty that levelled the scores but he was wide with a drop-goal attempt and Walsh was also off target with a one-pointer before Roberts eventually hit the mark.