A win would have lifted Trinity to third, above Hull and they could afford to lose by 14 points or fewer to finish ahead of Salford on points difference.
But Trinity trailed 24-6 at the break and though the narrowed the gap to just 10 points at the start of the final quarter, Saints’ strong finish – with tries by Louie McCarthy-Scarsbrook and Zeb Taia – denied Wakefield and moved Salford into the four.
Finishing fifth means Wakefield will have three home games and four away in the Super-8s.
Danny Richardson, James Roby, Tommy Makinson and Regan Grace crossed for Saints in the first half. Mark Percival converted all their tries and also landed two second-half penalties and Richardson booted a drop goal after the hooter.
Matty Ashurst’s try for Wakefield levelled the scores at 6-6 in the first half and Scott Grix and Mason Caton-Brown went over in the third quarter as Trinity closed the gap to 26-16. Liam Finn converted Wakefield’s first two tries.