That was their only real effort of the half as City dominated possession, and Stuart Green was, as usual, the man to thank for restoring parity with a superb 25-yard left-footed shot beating Adam Sollitt after 30 minutes.
But 15 minutes into the second half, City had another defensive lapse and Michael Twiss capitalised by running into the box unchallenged and hitting his shot through Boaz Myhill's legs.
This prompted a double substitution by Peter Taylor in the 65th minute, and it paid instant dividends with the equaliser just seconds later. Jon Walters, off the bench, had the ball in the right channel and cut it back for Michael Keane who finished well into the top corner.
Morecambe looked to catch City on the counter attack but were unable to test Myhill, and 4 minutes from time Walters popped up to get on the scoresheet for the first time since February. Stuart Elliott played him in, and he kept his nerve to slide the ball past Sollitt.
Danny Carlton had the chance to force the replay in stoppage time but headed wide, as City were relieved to see their name go into the Second Round draw on Monday instead of the Shrimps.
City line-up (4-3-3): Myhill; Joseph (France 65), Cort, Delaney, Dawson; Green, Ashbee, Keane; Barmby, Allsopp (Walters 65), Elliott.
Un-used subs: Duke, Lewis.