Substitute Jake Harris struck twice in the dying minutes to give Newport County an FA Trophy second round win at Worksop.
Elliott Buchanan struck first for the visitors and striker Massiah McDonald equalised.
But two goals from Harris in the last four minutes put the visitors through.
Newport County's reward is a home tie against Carshalton Town on Saturday, 4 February in the third round. Carshalton beat Lincoln 3-1 in the second round.