Hull FC (10) 16
Green, Yeaman, O'Meley Goals:
Huddersfield Giants (12) 22
Wardle, Ta'ai, McGillvary, Brough Goals:
A late try from captain Danny Brough saw Huddersfield to victory at Hull FC and back up to second in Super League.
Having trailed 12-10 at the interval, the home side drew level at 16-16 with a score from Mark O'Meley before Brough's last-gasp decider.
Joe Wardle, Ukuma Ta'ai and Jermaine McGillvary were Huddersfield's other scorers in a closely-fought encounter.
Chris Green and Kirk Yeaman also crossed for the Black and Whites, who have lost their last four matches.
Huddersfield had seen Warrington move above them in the table on Friday but they moved back to within a point of leaders Wigan with their win at the KC Stadium.
However, they fell behind as early as the second minute when prop Green collected Ben Galea's pass to touch down.
Giants centre Wardle soon responded, brushing off a tackle from Joe Arundel to score, before Ta'ai barged his way over to put the visitors in front.
Hull skipper Gareth Ellis provided the opportunity for Yeaman to close the gap before half time, although Danny Tickle missed the chance to level the scores, missing a tough conversion.
Against the run of play, Huddersfield stretched their lead as winger McGillvary caught Brough's high kick and strolled over the line, but O'Meley's powerful effort put Hull on terms.
Ellis's hard hit on Luke Robinson in the build-up to O'Meley's score left the Huddersfield scrum-half unable to continue and Giants coach Paul Anderson incensed after the match.
But the inspirational Brough, so often the Giants' talisman this season, burst past two Hull defenders to cross for the game's decisive try.
VIEWS FROM THE DRESSING ROOM
Hull FC coach Peter Gentle:
"If we would have played like that in the last two weeks we would have got the results.
"We've still got too many basic errors in us and our attack is still mis-firing.
"We talked at half-time about what we were supposed to be doing. We couldn't generate any speed of the play of the ball in the first half.
"We started the second half better and got some field position and if a few things could have gone our way it might have been a different result.
"I just had another look at Gareth Ellis' tackle on the video. He [Paul Anderson] better come and have a look at the video I've got.
"I didn't see anything wrong with it, not at all."
Huddersfield head coach Paul Anderson on Gareth Ellis's tackle on Luke Robinson:
"The tackle was a straight shoulder charge to the head. He's not knocked out for no reason.
"There are five people out there, one with the whistle, two with the flags and two muppets that stand at the other end of the field that don't see anything.
"It's a stone-cold shoulder charge to the head.
"Nothing will get done about [it], straight right shoulder to the head, it's a penalty. Luke is coming round, he knows he's in Hull at the minute."
On the game:
"We weren't so great today but we found a way to win.
"What we have done is a lot of practice on our try-line defence, and from today you can certainly tell.
"Defensively we have been outstanding all year."
McDonnell; Lineham, Arundel, Yeaman, T. Briscoe; Heremaia, Miller; Green, Houghton, O'Meley, Ellis, Westerman, Galea.
Lynch, Watts, Tickle, Whiting.
Grix; McGillvary, Cudjoe, Wardle, Murphy; Brough, Robinson; Crabtree, Lunt, Patrick, Ferres, Ferguson, Lawrence.
Faiumu, Ta'ai, Cording, Wood.
Phil Bentham (Warrington)