Nathan Ellington rolled home an injury-time penalty to send the Derby fans delirious at the Britannia Stadium.
Ellington kept his nerve in injury-time after Andy Griffin had been penalised by referee Rob Styles for handball.
Derby boss Paul Jewell: "People may have expected Nathan to blast a penalty in the last minute of a cup tie.