A lastgasp Dave Sutton try provided the nail in the coffin for the sorry Rams in a thrilling relegation sixpointer, which they lost 3228 to York.
Despite their lowly status, the two teams produced a pulsating endtoend game worthy of the top two teams.
The weather was made for fast open football and that is what was served up to the shirtsleeved spectators with Scott Turner racing in for a superb hat trick of tries for the Rams.
But it proved in vain as Sutton tied the scores in the dying moments, leaving the experienced head of Chris Thorman to pull the result from the fire with the winning touchline conversion.
It was a fitting end to a cracking contest.
York got the first points but after battering on the York line, Dominic Brambani placed a sweet grubber kick for Scott Turner to collect and score on 10 minutes.
But the Knights soon made amends as the fastmoving James Haynes was given the overlap from a superb Thorman pass and he went clear, offloading to Elliott Hodgson and he in turn sent the supporting Matt Garside in at the posts, Bush converting on 27 minutes.
Brambani cleared his danger area with a great 40metre run but York maintained their policy of moving the ball and Esders showed fine pace as he sped to the posts after a 45metre run and Bush converted on 36 minutes.
The Rams threw everything into attack and on 39 minutes Brambani’s delightful kick into the York in goal area was collected by Pat Walker for a try, Brambani converting.
And the Rams made it two tries in as many minutes as, into injury time, they charged upfield and Turner powered onto a Walker kick which had been missed on the York line. Brambani converted on the hooter.
Lockwood went close with a powerhouse run after Brambani’s 40/20 had given the Rams great field position early in the second half.
On 50 minutes Andy Smith used his power to charge over for Brambani to convert, the Rams had the lead.
The hectic nature of the game continued as Turner collected his hattrick on 55 minutes, he chased Walker’s kick to touch down but the try was unconverted.
Bush converted Thackray’s try on 60 minutes making it 2624 to the Rams and they increased their lead seven minutes later when Walker kicked a penalty goal to give his side a fourpoint advantage.
York however, spent little time in amending matters as Esders broke clear only for his pass to go astray.
The Rams counterattacked then York, in one lastgasp effort, attacked into their lefthand corner.
Sutton crossed by the flag for Thorman to claim these two crucial league points with a memorable kick from the sideline.
DEWSBURY: Elliott Hodgson 6, Andy Smith 6, Scott Turner 8, Ayden Faal 7, Austin Buchanan 7, Dominic Brambani 7, Patrick Walker 6, Keegan Hirst 6, Luke Blake 7, James Lockwood 9, Matt Sarsfield 8, Elliott Cosgrove 7, Josh Tonks 6. Subs: Richard Fletcher8, William Barteau 6, Anthony England 7, Matthew Tebb 7.
Tries: Turner (10, 40, 55), Walker (39), Smith (50).
Goals: Brambani 3/5 Pat Walker 1/1.
YORK: Tom Bush 8, Dave Sutton 7, Ryan Esders 9, James Ford 8, James Haynes 7, Chris Thorman 7, Anthony Thackeray 8, Nathan Freer 7, Jack Lee 7, Alex Benson 7, Duane Straugheir 7, Matt Garside 7, Rhys Clarke 7. Subs: Jonny Presley 8, Jack Aldous 7, Dennis Tuffour 7, Ben Jones 7.
Tries: Thackray (3, 60), Garside (27), Esders (36), Sutton (80).
Goals: Bush 4/5, Thorman 1/1.
Referee Chris Leatherbarrow / HT: 1618 / Pens: 75 / Sin Bin: None / Sent Off: None / Weather: Sunny / MOTM: James Lockwood (Dewsbury) / Attendance 964 / Match Rating 4/5.