Will Grigg came off the bench to bag a brace and prevent 2013 FA Cup winners Wigan from being bundled out at the second-round stage of this year's competition as they edged out non-league AFC Fylde 3-2.
Grigg's goal in the first game at Mill Farm earlier this month had been cancelled out by Danny Rowe, meaning a replay at the DW Stadium.
And Rowe's 64th-minute goal here had threatened an even bigger shock, having nosed Fylde into a 2-1 lead their enterprise had probably warranted.
But Grigg was on hand to convert a Gary Roberts cross with 10 minutes to go level the scores again, before the Northern Ireland striker grabbed the winner from even closer range with four minutes remaining.
Ivan Toney had earlier given Wigan the lead on the half-hour mark with a regulation finish from six yards after a superb cross from Callum Elder.
But Simon Grand had levelled the scores five minutes before the break with a shot that deflected past on-loan Aston Villa goalkeeper Matija Sarkic.
English FA Cup News
Leicester's Kelechi Iheanacho shows he's ready to lead the attack after sending Foxes to FA Cup final
Iheanacho has been the main understudy at Man City and now Leicester City, but his vital goal in the FA Cup semifinal shows he's ready to lead.
Leicester City hold off Southampton to book FA Cup final spot
Kelechi Iheanacho scored the game's only goal as Leicester City saw out a narrow victory over Southampton to book a spot in the FA Cup final.
Guardiola always insisted Man City winning four major trophies was nearly impossible. He was right
Man City's dream of a historic Quadruple is over after their FA Cup loss to Chelsea. However many trophies they now win, will they be satisfied?
Chelsea closing gap on 'benchmark' Manchester City - Tuchel
Chelsea coach Thomas Tuchel said his side were closing the gap with Manchester City and their "benchmark" coach Pep Guardiola.
What FA Cup glory would mean for Tuchel and Chelsea
Craig Burley examines how silverware would define Chelsea and Manchester City's respective seasons.
What was Zack Steffen doing on Chelsea's goal?
Shaka Hislop is befuddled by Zack Steffen's positioning on Chelsea's winning goal vs. Manchester City.