Saints led for most of a free-flowing match but they could never relax against the Challenge Cup semi-finalists, who were certainly a different proposition to the one that crashed to a 44-4 defeat at Langtree Park in March, which was before the appointment of Chris Chester as coach.
Trinity were trailing just 34-32 when winger Ben Jones-Bishop scored their sixth try in the 66th minute but Liam Finn was wide with the conversion that would have levelled the scores and Saints clinched a second successive win with late touchdowns from Jordan Turner and Matty Fleming.
Wakefield started the livelier side and, after running a penalty from in front of the posts, their confidence was justified when Miller jinked his way over for his first try on four minutes.
A handling error on his 20-metre line by second rower Jason Walton gifted the visitors a glorious attacking position and they made the most of it when centre Mark Percival took Jonny Lomax’s pass to cross for a try, moments after being held up on his back.
A storming run from St Helens prop Greg Richards then brought him his first try for the club and Percival’s first conversion made it 10-6 before Wakefield drew level through winger Tom Johnstone, who collected full-back Max Jowitt’s cut-out pass to grab his 17th try of the season.
St Helens looked to have gained control when the ever-dangerous Lomax went over for two tries in five minutes and Percival converted both to open up a 12-point lead.
However, Wakefield hit back on the stroke of half-time when Saints failed to clear the danger caused by a grubber kick on the last tackle from Miller, who followed up to pounce for his second try.
Finn’s second goal made it 22-16 but Saints regained their two-score advantage early in the second half when skipper Jon Wilkin got former Wakefield prop Kyle Amor racing into open space and substitute Morgan Knowles was in support to go over for their fifth try.
Miller intercepted a casual off-load from prop Alex Walmsley to sprint over from halfway and complete his hat-trick but as play swung from one end to the other hooker James Roby went over for Saints’ sixth try in the 57th minute.
But the visitors could never quite shake off the Wildcats, who set up an exciting finish when Finn sliced through the St Helens defence and winger Jones-Bishop flew over at the corner to take the home side’s try tally to six.
Finn was off target as he attempted to level the scores and St Helens stand-off Turner made sure of the win when he forced his way through a melee of defenders for the all-important score nine minutes from the end.
Wilkin sought to put the result beyond doubt with a snatched drop-goal attempt which went wide but Roby broke out of his own half and combined with Knowles and Amor to set up Fleming for a clinching try, with Percival kicking his sixth goal.