Widnes had led from the third minute of the game after a three-try opening blast in the first 11 minutes to lead 16-0 but fell behind for the first time in the match at 22-20 with just five minutes remaining.
But in the dying seconds Rhys Hanbury's kick hit the post and full back Phelps dived on the loose ball for the match winning try to which Patrick Ah Van added the conversion to seal a memorable win.
London Broncos sank to the foot of the table after going down to a seventh consecutive defeat with an insipid display in a 24-6 loss against Wakefield at Belle Vue.
The Broncos, whose disappointing performances prompted a mid-season review by chairman David Hughes, hit rock bottom after fellow strugglers Widnes beat Huddersfield.
London Broncos sank to the foot of the Stobart Super League after going down to a seventh consecutive defeat with an insipid display in a 24-6 loss against Wakefield at Belle Vue.
The Broncos, whose disappointing performances prompted a mid-season review by chairman David Hughes, hit rock bottom after fellow strugglers Widnes pulled off a surprise 26-22 win over Huddersfield ahead of Saturday's trip to the Twickenham Stoop.
For the second successive week Hull FC saw victory snatched away from them in the final minute as a late penalty from Tom Makinson meant St Helens grabbed an 18-18 draw at the KC Stadium.
A robust defensive performance by St Helens looked to be sending them home victorious after tries for Adam Swift, Lance Hohaia and Jon Wilkin, but Danny Tickle's late try and penalty gave Hull a narrow lead following scores for Richard Whiting and Richard Horne.
Leading for the first time with just minute remaining, Hull thought they had done enough until a penalty award with 90 seconds remaining handed their visitors a chance to level the scores.
Having lost the Hull derby in dramatic circumstances at the Magic Weekend, Peter Gentle's men again missed out but can console themselves at least with a point from a game they had enough possession to win twice over.
Michael Dobson's 77th-minute drop goal stunned Warrington to hand Hull KR a 23-22 win and cap a magnificent comeback at MS3 Craven Park.
A week after coming from 14 points down to beat Hull FC at the Magic Weekend, the Robins rallied from 22-6 behind to seal their third successive win in dramatic fashion.
Dobson was the hero as he has been so often during his time at Rovers, and the stage was set for him after directing Rovers back from the dead for the most unlikely of wins. The Australian finished with 11 points via his dramatic drop, a try and a goal while Josh Hodgson, Sam Latus and Craig Hall all went over.
Chris Riley scored two tries for the Wolves while Gareth O'Brien and Ben Westwood also went over with Brett Hodgson kicking three goals.