Hamilton Masakadza ended his 18-year international career with a blistering knock of 72 that included five sixes and four fours.
Zimbabwe vs Afghanistan: The win, Zimbabwe's first in the tournament after three successive losses, also ended Afghanistan's record 12-match winning streak in T20Is.
The tri-series kick-starts on September 13 with a game between Bangladesh and Zimbabwe at Shere Bangla National Stadium, Dhaka.
Chasing 118, South Africa lost their first four wickets for 58 runs but Heinrich Klaasen dashed Zimbabwean hopes.
Legspinner Devendra Bishoo proved Zimbabwe's nemesis once more as he spun the West Indies to a 117-run victory in the first Test at Queens Sports Club on Tuesday.
Taking the series 3-2, the 11th-ranked Zimbabwe team also registered their first series win in the South Asian nation.
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.
Zimbabwe stunned India by two runs to take 1-0 lead in three-match series. India skipper could not take team over the line with eight needed off the final over
Graeme Cremer, who missed the 2016 World T20 due to injury, will lead Zimbabwe for the series against India that begins from June 11.
Zimbabwe Cricket replaced coach Dav Whatmore and captain Hamilton Mazakadza with former South Africa pacer Makhaya Ntini and Graeme Cremer.