Wakefield grabbed their first away win of the season and their first over Huddersfield for four years in a Super League derby low on quality but high on drama.
The Giants were on course for a 10th successive win over their neighbours when they led 12-8 at half-time but the Wildcats overcame the absence of 10 senior players to dominate the second half and deservedly take the spoils.
The visitors, who gave a debut to 21-year-old second rower Kyle Bibb and a second appearance to teenage prop Jay Pitts, opened the scoring on five minutes, with scrum-half Danny Brough and full-back Scott Grix combining to get winger Aaron Murphy over at the corner, despite a suspicion of a forward pass.
Huddersfield, who gave a debut to 22-year-old former Featherstone winger Danny Kirmond, went in front with the aid of two tries in a five-minute spell midway through the first half.
Scrum-half Luke Robinson jinked through from dummy half for his seventh try of the season and winger Rod Jensen was gifted his fifth of the campaign when his opposite number Murphy dropped Chris Thorman's high kick.
Thorman converted both touchdowns to make it 12-4 but the Wildcats were in no mood to roll over and hit back with a second try on 27 minutes through centre Tony Martin after Giants winger Michael Lawrence, celebrating his 18th birthday, was deceived by a bouncing kick from Sam Obst.
Brough failed with both conversion attempts to leave his side trailing by four points at the interval but they drew level within three minutes of the restart.
Jensen attempted to collect Jamie Rooney's kick on the last tackle but only succeeded in kneeing the ball to substitute forward Oliver Wilkes, who will never score an easier try.
Martin added the conversion to restore the visitors' lead and, after Thorman had put over two penalties to make it 16-14, Brough and Martin each landed penalties of their own to once more tilt the game the Wildcats' way.
Wakefield began to assert their authority, with Brough tormenting full-back Thorman under the high ball and they created an overlap only for Tevita Leo-Latu to make a hash of the final pass.