|Hull FC (6) 19|
|Tries: Fonua, Sneyd, Ellis. Goals: Sneyd 3. Drop goal: Sneyd.|
|Wakefield (12) 18|
|Tries: Arundel, Miller, Caton-Brown. Goals: Finn 3.|
Gareth Ellis marked his farewell home game with a vital try as Hull FC fought back to beat Wakefield and all but seal their Super League play-off place.
Trinity controlled the first half with Liam Finn's kicking teeing up scores by Joe Arundel and Jacob Miller to leave Hull facing a fourth successive loss.
But tries from Mahe Fonua and Marc Sneyd levelled matters.
Ellis then powered over and Sneyd's boot ensured victory, despite a late try for Mason Caton-Brown.
Trinity, who remain fifth and must beat fourth-placed Wigan in their final game to stand any chance of making the top four, could have snatched a draw.
But Finn's late drop goal attempt, which would have cancelled out Sneyd's drop goal, was fractionally wide.
Hull FC's win means they could still qualify even if they lose their final Super 8s game against Castleford, and they will be relieved to have their fate in their own hands having been second best before the break.
Wakefield's impressive first-half efforts could easily have seen them leading by a far greater margin than their six-point advantage.
Finn's two superb kicks - the first crossfield and the second straight but perfectly weighted - led to tries for ex-Hull FC duo Arundel and Miller, the later scoring with a brilliant one-handed touch down.
Fonua's towering leap from Albert Kelly's kick got Hull back in the game, but they were far from their best with their play featuring too many handling errors and a lack of cohesion in attack.
A fine dummy and run by Sneyd saw him power through for a second home try after the interval to make it 12-12 and Hull just about held on for a dramatic win after 36-year-old Ellis' heroics.
Hull FC: Shaul, Fonua, Griffin, Tuimavave, Michaels, Kelly, Sneyd, Taylor, Houghton, Watts, Minichiello, Manu, Ellis.
Replacements: Bowden, Fash, Thompson, Connor.
Wakefield Trinity: Grix; Jones-Bishop, Arundel, B. Tupou, Caton-Brown; Miller, Finn; England, Randell, Huby, Ashurst, Kirmond, Arona.
Replacements: Wood, Fifita, Annakin, Hasson.
Referee: Phil Bentham (RFL).