In a game of few chances Notts County scored two late goals at Wigan at a near-deserted DW Stadium.
Stephen Hunt gave County the lead with 15 minutes remaining, heading home from a corner.
Previous to this Wigan had spurned the two best chances of the game through Jason Scotland and Scott Sinclair.
Danny Butterfield second half hat trick in six minutes between the 62nd and 68th minutes stunned the Premiership side who replied in the last minute from Karl Henry.
A first half of few openings was followed by a second period which suddenly sprang to life.
His first came after 62 minutes when he nodded home from close range.
Three minutes later he put Palace in complete control as he was sent clear by Darren Ambrose and slide the ball into the back of the net with ease.
A remarkable hat-trick was then completed on 68 minutes when Butterfield reacted first and poked he loose ball through the keeper's legs.
Championship Palace, who are currently in administration, set themselves up for another Premiership team, Aston Villa in the last 16.