The 19-year-old will go on to face either Alison Riske of the United States or Kaia Kanepi of Estonia, a former All England Club quarter-finalist.
Sam Smith, in 1998, was the last British woman to make the last 16 at Wimbledon.
Robson, currently ranked 38 in the world, will also break into the top 30 after the tournament, the first British woman to break that barrier since Jo Durie in April 1987.
“I was getting my butt kicked in the first set,” said Robson.
“I was struggling to return her serve in the first set and Marina was playing really well.
“But I told myself just to keep working hard, she will get nervous and that’s what happened.”
Erakovic, bidding to become the first New Zealand woman to reach the round of 16 at Wimbledon in the Open Era, served for the match at 5-4 in the second set before her nerve failed her and Robson went off on a key eight-game winning streak.