The 17-year-old had scored one and created another to help the Reds take a 2-0 half-time lead over Portsmouth on Tuesday night.
But a fightback by the visitors saw the tie level heading into stoppage-time – when Duncan pounced on a cross from strike partner Paul Glatzel to net a dramatic decider.
Barry Lewtas’ side will face Accrington Stanley in the fourth round.
“It was unbelievable,” Duncan, who now has 19 goals this season, told Liverpoolfc.com.
“Paul had a great turn in the box and picked me out – I stuck my right foot on it and it went in.