On the back of eight straight losses things could hardly have got off to a worse start for the Giants when Johnstone got in at the corner and prop McMeeken then dotted down, after Rourke flicked Jake Trueman's kick back.
However, they did not go under and two solo efforts in four minutes from Gagai and Geyer saw them turn the match on its head for the first time.
Sinfield's first Super League try since joining from Leeds in the off-season gave Wakefield a 16-12 lead at the break, but Russell kicked a 40/20 in the first play of the second half and O'Donnell crashed over.
Huddersfield, who were looking for a first wince since 4 April, could not hold on to their narrow lead as Jowitt kicked a penalty after a high shot on McMeeken to level and Rourke held off the attentions of three players to get in at the corner.
The visitors fought back once more when Swift cut in off the left edge and grounded the ball to make it 22-22.
Sinfield's drop-goal nudged Wakefield back into the lead before Russell's long-range effort levelled the scores yet again.
But the former Trinity man was left desolate when his pass was grabbed by Rourke who managed to get away from the chasers and win it.
Huddersfield will raise the curtain on Magic Weekend when they play York Knights at Everton's Hill Dickinson Stadium next Saturday, with Daryl Powell's men playing his former side Castleford in Sunday's first match.
Wakefield: Jowitt, Rourke, Scott, Pitts Johnstone, Sinfield, Trueman, Tevaga, Vagana, Nikotemo, Rodwell, Smoothy, McMeeken.
Interchanges: Hamlin-Uele, Smith, Lolesio, Tate.
Huddersfield: Flanagan Jr, Swift, Jagger, Gagai, Milne, Lolohea, Russell, Powell, Dunford, O'Donnell, Rogers, Rush, Patolo.
Interchanges: English, King, Cozza, Geyer.