But Swans Roger Freestone was also guilty of failing to make a save 15 minutes into the second half. He couldn't keep out Ben Burgess' shot from the edge of the area despite getting his hands to it as City went 2-1 up.
City then gave their lead away again in the 83rd minute with Swansea hotshot Lee Trundle levelling for 2-2.
However, City weren't finished and scored again 3 minutes from time. Substitute Jon Waters's deflected cross was headed home by Burgess to seal a crucial 3-2 win.
City line-up (4-4-2): Myhill; Thelwell, Joseph, Delaney, Dawson; Green (France 72), Ashbee, Lewis, Elliott (Hinds 90); Allsopp (Walters 81), Burgess.
Un-used subs: Musselwhite, Forrester.