Rathvilly had turned a two points deficit into a two points lead in the second-half and, with wind assistance, looked to be on course to advance to the second round.
But at the three-quarter-stage they were rocked when star centre-back Brendan Murphy was sent off on a second yellow. They looked to have weathered the storm leading 1-9 to 0-10 with five minutes remaining.
But Rathnew kept battling and Eddie Doyle narrowed the gap to a point from a free. Two minutes later, full-forward Jody Merrigan had the ball in the net following smart play by midfielder James Stafford.
Rathnew had turned the game around to lead 1-11 to 1-9 and they duly battened down the hatches. In injury time veteran Tommy Gill drilled over his fifth point from frees and Stafford added another to seal the deal on a victory most thought unlikely earlier in the second-half.
Rathnew had the wind in the first-half but only led 0-7 to 1-2 at the break after shooting eight wides. They had gone two points up in the first seven minutes with Eddie Doyle frees, but Rathvilly hit them with an opportunist goal, scored by midfielder Ken Doyle on 12 minutes.
Scorers for Rathnew: Jody Merrigan 1-0, Eddie Doyle 0-4 (frees), Tommy Gill 0-5 (frees), James Stafford 0-2, Graham Merrigan 0-1, Philly Murphy 0-1.
Scorers for Rathvilly: Ken Doyle 1-0, Gary Dempsey 0-5 (three frees), JJ Smith 0-2 (frees), Alan Kelly 0-1, Brian Murphy 0-1 (free).
RATHNEW: P Dignam, P Merrigan, D Power, J Manley, G Merrigan, R O’Brien, J Snell, J Stafford, A Merriman, E Doyle, T Smith, D Jameson, T Gill, J Merrigan, P Murphy.
Subs: E Glynn for R O’Brien (15m), S Byrne for G Merrigan (43).
RATHVILLY: R Molloy, A Sibbaid, K Byrne, BJ Molloy, G. O’Donoghue, Brendan Murphy, Jim Bob Leonard, K Doyle, Brian Murphy, W O’Donoghue, E Finnegan, A Kelly, G Dempsey, D Cronin, JJ Smith. Subs: E Molloy for D Cronin (45), P Byrne for W O’Donoghue (53), C Byrne for G O’Donoghue (60).
Referee: B Cawley, Kildare.