With the hooter sounding, the visiting Dons managed to work the ball right where Liam Johnson went through a gap to get over in the corner for his second try and level the scores.
Jake Sweeting then held his nerve to land the conversion from out wide and send Dons through to a meeting with Workington Town at their Derwent Park home on Sunday at 1pm.
The only time Dons led on the scoreboard was a full-time having trailed 12-0 early on and by 26-12 with just twenty minutes to go.
Cougars took early control as Scott Murrell’s eighth-minute grubber set up Jack Miller for a try he also converted.
Four minutes later, the division’s young player of the year, Phoenix Laulu-Togaga’e got the second, improved by Miller.
Dons got on the scoreboard courtesy of Alex Holdstock’s try, improved by Matty Beharrell on 18 minutes and then six minutes later they levelled as Berharrell touched down and converted his own try.
Miller’s penalty gave Keighley the half-time lead, which Murrell extended with a try on 47, Miller again tagging the goal.
Keighley seemed in complete control when Charlie Graham ran 80m for a try converted by Miller and a 26-12 lead on 58 minutes.
Dons’ revival started with Johnson’s first try under the posts, converted by Sweeting on 63. Ben Johnson had a try ruled out ten minutes later, before Jason Tali (75) finished off Sweeting’s break.
Sweeting missed the goal but when Johnson went over at full-time he made no mistake to break Keighley hearts.