Jack Mackreth came off the bench to score a brace, including a penalty in the 90th minute, to complete a turn around from a 1-0 half time deficit.
It looked like the Yellows’ title hopes would be left in tatters after Ashley Worsfold had given Trinity the lead four minutes before half time, but Mackreth’s equaliser 18 minutes from time set up the frantic finale.
After a defeat and a draw in the last two outings, both to Stafford Rangers, and losing ground on South Shields due to North Ferriby’s collapse, Warrington desperately need a result to reignite their bid for top spot.
The Yellows had won the reverse fixture 4-1 but the Holy Blues had won four of their last five under new manager Liam King, as they bid for the final play-off place.
A stop-start opening quarter of an hour saw little in the creation of chances, save from a handful of corners, as the referee’s whistle sounded at regular intervals.
The first real sight of goal came on 19 minutes when Josh Amis held the ball up well on half way, played a one-two with Tony Gray and then shot softly at Joe Green, who played well in the Gainsborough goal.
Dylan Vassallo on the left for Warrington and Alex Byrne on the right for Gainsborough were having their share of the ball outwide and both put in a couple of dangerous crosses that came to nothing.
On the half hour mark, Gainsborough captain Shane Clarke got up with a firm header that had ‘keeper Tony McMillan at full stretch to save one-handed to his left.
At the other end, Shaun Beeley’s long throw fell in the box for Ben Garrity, whose rising first time shot hit the top of the crossbar.
But Trinity would go in to the break in front, Alex Simmons’ shot was charged down and with confusion between Garrity and Dave Raven, Gainsborough’s top scorer Ashley Worsfold nipped in and finished clinically past McMillan.
Warrington came out with renewed purpose after the break and hit the woodwork again six minutes in to the second half, Adam Hughes’ drilled ball from the left coming off Amis’s shins and then wide off the post.
The Yellows were forcing the visitors back, and Tony Gray forced a good stop out of Green from a 20-yard free-kick at the edge of the box.
The visitors were dealt a blow when imperious centre half Nathan Stainfield was forced off injured, and within seven minutes of him going off, the Yellows were on level terms.
Another substitute, Mackreth, chased down a ball down the right alongside team-mate Amis, who moved the ball inside for the winger, no doubt with last week’s glorious chance missed at Stafford in mind, to bury in to the far corner for 1-1.
The game levelled out for a spell after that, but Warrington thought they’d struck the winner in the 82nd minute when Mackreth’s cross was volleyed home by Gray, only for the referee’s whistle to deny the hosts, for a foul by Amis.
In the end, it would be another substitute that would have a telling impact on the game. Marcus Cusani looked like he had got the ball stuck under his feet and fell to the ground under pressure from Ioan Evans, and the referee pointed to the spot to the bemusement of many in the ground.
Mackreth stepped up and kept his cool from the spot to earn a vital three points for the Yellows, whose two title rivals also won on Saturday afternoon.
Warrington Town: McMillan, Beeley (Dixon), Hughes, Garrity, Roberts, Raven, Dunn (Cusani), Evans, Gray, Amis, Vassallo (Mackreth). Unused subs: Benjamin, Duggan.
Gainsborough Trinity: Green, Austin, Davie, Russell, Maguire, Stainfield (Evans), Byrne, Clarke, Worsfold, L Hughes (Hannah), Simmons (Middleton). Unused subs: B Hughes, Reeves.
Pictures John Hopkins