The Giants produced their best performance of the season to push the title favourites all the way in a thoroughly entertaining clash at the Galpharm Stadium.
Saints, who gave a debut to 18-year-old half-back Matty Smith in the absence of the rested Sean Long, were forced to defend for long periods and demonstrate just why they have the best defence in the league.
Huddersfield made the worst possible start, with former St Helens forward Stuart Jones knocking on from the kick-off, and they conceded a try within 46 seconds.
Huddersfield, who gave a debut to second rower Andy Raleigh, recovered from their woeful start and - in an even first half - ought to have made more of breaks by half-backs Robbie Paul and Chris Thorman.
St Helens withstood all the Giants threw at them and struck a decisive blow five minutes before half-time when Pryce broke down the middle, creating the position for Lyon to cross for a second try.
All Huddersfield had to show for their commendable efforts were two penalty goals from Thorman, who added a third early in the second half to cut the gap to six points.
And the deficit was down to just two on the hour when hooker Brad Drew was on hand to regather possession from Thorman�s high kick and touch down.
But Saints� response was swift and decisive, Willie Talau relieving pressure with a break from his 20-metre line, which set up the position for Maurie Fa�asavalu to take Keiron Cunningham�s short pass and crash over for the all-important score.
Lyon kicked his third goal from as many attempts to make it 18-10 but Huddersfield set up a thrilling finish when substitute Paul March broke clear from his own 20-metre area and sent former Wigan loose forward Stephen Wild racing over for the try of the match.
Huddersfield: Reilly, Aspinwall, De Vere, Torrens, Gardner, Thorman, Paul, Crabtree, Drew, Snitch, Nero, Jones, Wild. Replacements: March, Smith, McDonald, Raleigh.
St Helens: Wellens, Gardner, Lyon, Talau, Meli, Pryce, Moore, Cayless, Cunningham, P. Anderson, Gilmour, Sculthorpe, Hooper. Replacements: Wilkin, Smith, V. Anderson, Fa�asavalu.
Huddersfield (4) 16. Tries: Drew, Wild. Goals: Thorman 4.
St Helens (12) 18. Tries: Gardner, Lyon, Fa�asavalu. Goals: Lyon 3.
Referee: R Silverwood (Dewsbury)