Oliver Clark headed home a Niall Davie free kick on 38 minutes to open the scoring and the same combination saw Clark head home a Davie corner four minutes into the second half to double the lead.
The Saints hit the post through Prince Mutswunguma after a mix-up in the Carlton defence and were back in the match when Sam Goode converted from a Lee Watkins corner on 72 minutes.
The Millers secured victory with three minutes remaining when Tom Maddison scored from the penalty spot after Mamoke Akaunu was brought down by Aaron Smith.
Carlton will be at home to either Biggleswade or Bedford Town in the preliminary round on 12 October. Those teams drew 2-2 today and replay in midweek.
Carlton's next match is away at Chasetown next Saturday.
A full report on today's game will be on site tomorrow.