Media playback is not supported on this device
The Hatters led at the break through Luke Guttridge's stunning 30-yard shot.
Yan Klulowski volleyed an equaliser, but Paul Benson bundled the ball over the line to put Luton back in front.
Aaron O'Connor nodded Newport level again, but substitute Ricky Miller's shot made it 3-2 and Jake Howells sealed victory with a fine low shot.
Luton Town manager John Still told BBC Three Counties Radio:
Media playback is not supported on this device
"We've played well today, moved the ball well, created chances and scored four goals, so I've got to be happy.
"In the FA Cup you've just got to get through and we've done that today.
"As far as I'm concerned, we need to approach this competition as we would a Football League match - absolutely 100%."
Newport County manager Justin Edinburgh told BBC Radio Wales:
"We're bitterly disappointed not to have got something out of the game in the end.
"We went behind from a poor decision, a blatant free-kick. A couple of key decisions have gone against us.
"We got back into the game, I thought we played really, really well at times.
"We'll put in a report, highlight those key incidents that we feel continuously went against us."
Luton Town scored twice in the final 13 minutes to finally break the resistance of fellow League Two side Newport in a thrilling FA Cup first-round tie.