The Wolves looked to have secured only their second win over their illustrious neighbours in 22 Super League meetings when they led 16-4 with 10 minutes left.
But, just as Bradford came back from the dead to steal the points from Wigan seven days earlier, never-say-die Saints struck with three tries in six minutes to claim their third win in four games and join Leeds Rhinos at the top of the table.
Winger Darren Albert, celebrating his 100th appearance for the club, sparked the unlikely comeback with his 65th try before acting captain Keiron Cunningham grabbed the winner with the last move of the match.
St Helens had earlier had two tries disallowed by the video referee but they could have had few complaints had the result gone against them.
They sorely missed injured Great Britain pair Sean Long and Paul Sculthorpe, although Micky Higham and young half-back James Roby did their best to inspire their side.
The Wolves scored only two tries, with Lee Briers kicking four goals from four attempts, but they missed two other glorious chances after dominating the game for long periods.
The visitors were denied after only three minutes when the video referee decided Warrington winger Henry Fa?afili had been pushed off the ball by his opposite number Ade Gardner before Willie Talau touched down.
And their disappointment was compounded 10 minutes later when Dave Campbell ruled in favour of Fa?afili when Saints full-back Paul Wellens dropped the ball from Brent Grose?s high kick and the Kiwi winger touched down for a try.
An 8-4 interval lead was nothing more than Warrington deserved after producing the more penetrating rugby throughout the first half.
The visitors missed too many one-on-one tackles and the Wolves would have been further ahead but for some over-elaboration at times.
Centre Martin Gleeson, playing against his old club for the first time since his ?200,000 transfer, was held just short and younger brother Mark ought to have made more of a clean break just before the break.
Saints picked up the tempo when Roby was introduced 10 minutes before half-time and they got back in the game when Higham got the strong-running Graham into his stride near the line and the teenager forced his way past Dean Gaskell to touch down.
Briers extended Warrington?s lead to 10-4 six minutes into the second half with a second penalty after the visitors were caught offside.
And the home side should have been further in front when Mark Gleeson broke away from dummy-half to split the St Helens defence, but loose forward Ben Westwood dropped Briers? pass with the line beckoning.
The darting runs of Mark Gleeson and Graham Appo caused all sorts of problems for the Saints defence but they were still in contention as the game entered the final quarter.
The Wolves suffered a blow when second rower Logan Swann limped off on 56 minutes but they almost scored again when hooker Jon Clarke picked up a loose ball and dived over the line only for the video referee to rule a knock-on.
It was then Saints? turn to have a try disallowed, with substitute Maurie Fa?asavalu was brought back for a ball-stealing offence on Westwood.
Briers had a drop goal charged down but Warrington looked to have wrapped up the win on 71 minutes when Appo took Westwood?s pass to touch down.
But Saints saved their best for last in a tremendous finale, with Albert crossing on 74 minutes.
Higham then took a pass from Cunningham to cross for another try and Wellens, after missing with his first two kicks at goal, added the conversion to cut the gap to just two points.
And time had run out when Jamie Lyon hoisted a hopeful kick which bounced back off the hand of Albert into the grateful arms of Cunningham, who burrowed his way over for the dramatic winner.
Warrington: Grose, Faa'fili, Martin Gleeson, Kohe-Love, Gaskell, Briers, Appo, Leikvoll, Clarke, Hilton, Swann, Wainwright, Westwood. Replacements: Bracek, Stevens, Mark Gleeson, Lima.
St Helens: Wellens, Hardman, Albert, Talau, Gardner, Lyon, Higham, Fozzard, Cunningham, Anderson, Gilmour, Bennett, Wilkin. Replacements: Edmondson, Fa'asavalu, Roby, Graham.
Warrington: (8) 16. Tries: Faa'fili, Appo. Goals: Briers 4.
St Helens: (4) 18. Tries: Graham, Albert, Higham, Cunningham. Goals: Wellens.
Referee: Ian Smith (Oldham)