With away trips to St Helens and Warrington in the next week, Stuart Raper's side could scarcely afford a second defeat against the season's surprise outfit, who beat them at Belle Vue in June.
Wakefield shocked an expectant home crowd through a sparkling try inside the first minute when their winger, Neil Law, finished off an angled 50- metre run by the full-back Shane Kenward.
Danny Orr pulled back two points with a penalty before the Castleford captain, Adrian Bowles, showed his immense value to his side with two converted tries in four minutes.
The influential Aaron Raper sent Bowles slicing through and inside Kenward's challenge before Orr's fine pass gave Bowles the opportunity to burst over from 20 metres.
When Raper cleverly worked the blind side for the winger Richard Gay to finish clinically, Castleford had opened up a seemingly decisive 16- 4 interval lead. But Wakefield showed the spirit that has marked their first season in Super League with a tremendous second-half fightback.
Their scrum-half, Glen Tomlinson, took on the close-range defence to burrow his way over by the posts and Ian Tolbert's conversion reduced the arrears to six points.
Orr gave the home side breathing space with a 56th-minute penalty try that he converted. Orr, having chased Brad Davis's chip, hacked the loose ball ahead before being obstructed by Tomlinson.
But Wakefield hit back with a powerful run from halfway by Law to set up a converted try for the supporting Paul March, and a later Tolbert penalty left the Wildcats only four points behind.
It took a close range try by the substitute Brad Hepi three minutes from time to settle the Castleford nerves and prepare them for a week that may shape the destiny of their season. A surging Hepi run set up an injury- time try for the winger Darren Rogers that gave the scoreline a flattering look.
Castleford Tigers: Flowers; Gay, Maloney, Eagar, Rogers; Orr, Davis; Sampson, Raper, Sykes, Harland, Fritz, Vowles. Substitutes used: Smith, Tonks, Hepi, Wells.
Wakefield Trinity Wildcats: Kenward; Stott, Fawcett, Hughes, Law; Kemp, Tomlinson; Stephenson, Talbot, Jackson, Price, McDonald, Poching. Substitutes used: P March, Crouthers, Watene, Field.
Referee: J Connolly (Wigan).Reuse content