Dewsbury Rams needed a drop goal from substitute Lewis Fairhurst in golden-point extra-time to edge neighbours Batley Bulldogs 23-22 in the fifth round of the Ladbrokes Challenge Cup at the Tetley's Stadium.
Macauley Hallett opened the scoring early with the first try of his brace as the Bulldogs took the lead five minutes in. But Josh Guzdek struck back for the home side before Hallett claimed his second midway through the first half, which Cain Southernwood converted.
Batley's Tom Lillycrop added his side's third score - with Southernwood again on target with a goal - as the visitors moved 16-4 ahead before Paul Sykes reduced the deficit for the Rams.
Guzdek bagged his second try on the half-time hooter with Sykes converting to bring Dewsbury back into it.
The home side took the lead for the first time when Aaron Brown crossed over after 54 minutes and Sykes converted before scoring another goal three minutes later.
Dominic Brambani crossed over for the Bulldogs and Southernwood claimed two more points late on to level the scores after 80 minutes and then Fairhurst's drop goal meant the Rams will be in Tuesday's sixth-round draw.