They squared the match at 10-10 with two minutes remaining. And it wasn't until nine seconds from the end of a frantic finale that a Castleford exclusion allowed Joao Martins to grab the winner - with just two seconds to go!
Martins finished with four goals while Luke Franks scored five for Castleford.
Cambridge also left it late to complete their second win of the weekend - 11-9 against Birmingham. The Midlanders held a narrow lead for much of the first three periods - and were still 8-7 up at the start of the last. After that, it was all Cambridge, James Poole and Chris Scotney both netting twice as Birmingham's challenge faded.
Portobello were the only other side to win both their games. Hadrien Collineau scored five in a 13-6 defeat of Bridgefield. Four goals in the third quarter by Ciaran Mann (picture, Trevor Hyde) secured Southampton's 12-10 win against Ealing.