Ervine scored 130 not out off 108 balls as Zimbabwe made 304 for three, reaching their target with five balls to spare.
Ervine struck five sixes and 11 fours in a cavalier innings to secure a rare Zimbabwe victory which gave the hosts a 1-0 lead in the three-match series.
New Zealand, playing without several regulars who led them to the World Cup final this year, scored 115 runs in the last 10 overs to push their score to 303 for four off 50 overs.
Ross Taylor made 112 not out and stand-in captain Kane Williamson, deputising for Brendon McCullum, was bowled for 97.
Grant Elliott added a cameo 43 off 32 balls to remind the Kiwis of his exploits at the World Cup in March.
Zimbabwe replied with a solid foundation of 87 for the first wicket but looked to be facing the possibility of another late meltdown when Hamilton Masakadza was the second wicket to fall at 194 with 15 overs left.
Masakadza scored 84 before being caught behind off a thin outside edge.
But Ervine proved steady amid the tension of the chase and, with support from skipper Elton Chigumbura (36), took his country to only their third ODI win in 15 games this year.
The winning run came off a wide from Nathan McCullum at the start of the last over with Zimbabwe having tied the scores at the end of the 49th over.