A freak Paul Rodgers goal settled an astonishing FA Cup tie as Newport progressed to the first round proper.
Rodgers' intended cross from the right touchline flew into the net with just two minutes remaining.
Ben Wright had put Braintree ahead on nine minutes before Sam Foley and Craig McAllister replied for County.
Andy Yiadom made it 2-2 and Kenny Davis made it 3-3 after Nat Jarvis had put the home side in front, but Rodgers' slice of luck sent Newport through.
VIEW FROM THE DRESSING ROOM:
Newport County manager Justin Edinburgh: "It was a fantastic game of football - some great goals and two good teams.
"I was just thankful we got that winner at the end. We thought we were heading back to Essex [for a replay] but it just shows how far this group have come in a short space of time in terms of their character and belief.
"A lot of positives came out of today's performance."
Newport County: Potter, Miller, Yakubu, Rose, McAllister, Foley, Knights, Doherty, Hughes, Hatswell, Rodgers.
Subs: Rogers, Jarvis, Thompson, Newman, Greening, Jardim, Velez.
Braintree Town: McDonald, Peters, Thomas, Paine, Reason, Davis, Marks, Wright, Quinton, Yiadom, Stevens.
Subs: Bailey-Dennis, Symons, McCammon, O'Connor, Johnson, Chilaka, Ashlee Jones.
Referee: P Bankes.