Castleford gained two vital points to boost their survival bid with debutant Danny Brough playing a starring role.
The 23-year-old was a pivotal figure as the Giants were toppled by a rousing second-half display.
Brough, signed from Hull just three days earlier, set up two tries and landed four goals to crown a sparkling performance in which centre-wing partnership Waine Pryce and Gray Viane each scored two tries.
Huddersfield, who welcomed back Chris Thorman after a long injury lay-off, posted 22 points in the opening 12 minutes at The Jungle earlier this season. But there was no repeat of that dream start as Cas stormed 6-0 ahead inside three minutes. Pryce with time and space to score off Danny Sculthorpe's fine kick. Brough goaled.
The Giants slowly established midfield authority and crossed twice in six minutes. Winger Stuart Donlan scrambled his way to the corner from a pass by second row Paul Smith who then finished a slick move to score the visitors' second touchdown after great work from Chris Nero and Donlan.
Cas hit back strongly. Back row Danny Ward crashed over from close range for his first try in Tigers colours and Samoan centre Viane pounced after Brough's kick undid a flat defence.
Brough goaled both tries for an 18-10 lead only for Donlan to complete his double to close the gap.
But Pryce, not to be out done, showed fleet of foot to sail in from Brough's long pass 10 minutes into the second half and the Tigers scored the try of the game 12 minutes later. Willie Manu sparked the move that ended with Pryce putting Viane over for his second of the match.
The Giants' response was met by some resilient home defence and 13 minutes from the end the Tigers made the game safe when substitute winger Adam Fletcher, making only his second appearance for the club, barged his way to the corner after being set up by centre Ryan McGoldrick and Michael Shenton.