Hull re-established a two-point lead at the top of Super League, but needed a first try of the season from substitute Danny Washbrook three minutes from the end to clinch a thrilling victory over Saints.
Saints overcame a disastrous start in which they lost influential scrum-half Luke Walsh with a leg injury and fell 12-0 behind to get themselves into a winning position.
Hull re-grouped in time to secure a third win of the season over Keiron Cunningham’s men, who are now six points behind the pacesetters but will be heartened by a spirited showing in the battle for the Steve Prescott Cup.
St Helens could hardly have made a worst start, losing Walsh inside two minutes, and they spent the first quarter pinned inside their own 20-metre area.
Prop Liam Watts broke through the first line of defence to get Hull captain Gareth Ellis over for the first try and strong-running centre Mahe Fonua added a second on 15 minutes after the home side ran a penalty from in front of the posts.
Marc Sneyd kicked both conversions to make it 12-0 and it could have been more, with prop Scott Taylor dropping the ball in a try-scoring position.
With skipper Jon Wilkin slotting into the halves alongside an impressive Theo Fages, though, Saints gradually weathered the storm and struck back with two tries in a three-minute spell.
Jonny Lomax, who played a full game at full-back for the first time since making his tentative return from his latest knee re-construction, was the architect of the revival, sending winger Adam Swift over for one try with a smart cut-out pass and then dummying his way over.
Jack Owens converted both tries from the touchline to level the scores and Saints went in front three minutes before half-time when Fages’ careless pass was touched by Sneyd to gift a score to second rower Atelea Vea.
Owen’s third goal made it 18-12, but Sneyd pulled two points back with a penalty on the stroke of half-time and Hull might have scored the first try of the second half but for an important interception by Swift.
The game then became scrappy as both sides struggled for any sort of cohesion.
After a rare scrum heel against the feed, Saints forward Greg Richards lost the ball striving to reach the line and the stalemate was finally broken on 56 minutes when stand-off Carlos Tuimavave, who was preferred to Leon Pryce, jinked his way through a hole in the visitors defence for Hull’s third try.
Sneyd’s fourth goal edged his side 20-18 in front and a booming 40-20 kick from Danny Houghton got Hull into a great attacking position, only for second rower Jordan Thompson to spill the ball charging for the line.
The pivotal moment came on 63 minutes when Tuimavave’s tentative kick was knocked down by St Helens prop Kyle Amor and Taylor followed up to notch a fortuitous try, which Sneyd goaled.
Taylor crossed again shortly afterwards after a break by substitute Josh Bowden, but he was brought back for a forward pass and Saints gave themselves renewed hope when young back rower Jack Ashworth forced his way over for the visitors’ fourth try on 69 minutes.
The game was finally settled on 77 minutes when Washbrook collected a Saints’ goal-line drop-out and twisted out of the tackle to sprint 30 metres unopposed for Hull’s fifth try and Sneyd kicked his sixth goal from as many attempts.