Chasing a Duckworth-Lewis revised target of 219 in 31 overs, Zimbabwe rode on Ervine's 55-ball unbeaten knock to win with 10 balls to spare at the Mahinda Rajapaksa International Stadium.
Earlier, openers Niroshan Dickwella (116) and Danushka Gunathilaka (87) put together 209 runs in Sri Lanka's 300-6 -- becoming the first pair in ODI history to score back-to-back double century partnerships.
The left-handed batting duo had put on a 229-run match- winning stand in the previous ODI on Thursday at the same venue but their efforts went in vain the second time around.
But Ervine and Malcolm Waller (20) made sure the chase remained on track with their 43-run sixth-wicket partnership after rain interrupted play for over one-and-a-half-hours.
Also Read
"We knew we were ahead (of the rate) and we were always in the game and the way we batted was excellent," Zimbabwe skipper Graeme Cremer said in the post-match presentation.
"We have seen we can chase down a score and set a score and our batting has come right," Cremer said on the prospect of his side eyeing a major series win in over eight years.
For the hosts, Dickwella hit his second successive century with a commanding knock, while Gunathilaka was bowled 13 short of what could have been his second ODI ton.
Wicketkeeper-batsman Dickwella, who scored 102 in the third ODI, played a patient 118-ball knock laced with eight boundaries before being trapped lbw.
Zimbabwe off-spinner Waller got the two prized wickets in successive overs to pull things back for the visitors.
Paceman Chris Mpofu also got two wickets to rattle the Sri Lankan middle-order as the hosts slipped from 216-1 to 263-5.
Meanwhile Cremer was docked 20 per cent of his match fee for his team's slow over rate while the rest of the side was slapped with a 10 percent penalty.
Zimbabwe were found to be one over short of their target after time allowances were taken into consideration by the International Cricket Council (ICC) match referee Chris Broad.
Sri Lanka captain Angelo Mathews, who lifted his side's total with his 40-ball 42, said that even though he felt "300 was enough", the batsmen's shot selection was not up to the mark.
Disclaimer: No Business Standard Journalist was involved in creation of this content