Ali scored a 104-ball 102 for his second one-day century to help Pakistan chase down a target of 269 in 47.2 overs at Gaddafi Stadium for a 2-0 lead in the three-match series.
For Zimbabwe Pakistan-born Sikander Raza smashed an 84-ball 100 not out with eight fours and three sixes while Chamu Chibhabha's career-best 99 had 11 fours and a six which lifted the score to 268-7.
Pakistan won the first match by 41 runs in Lahore. The third and final match will also be played at the same venue on Sunday.
International cricket remained suspended in Pakistan since terrorists attacks on the Sri Lankan team bus in Lahore in March 2009.
More From This Section
Massive security remained in place with 4,000 policemen guarding the stadium during all matches.
Police said there was a transformer explosion, some one-and-a-half kilometres away from the stadium, but the match was not affected as Ali led Pakistan's march towards victory.
Ali hit eight boundaries in his 104-ball knock and improved on his best score of 101 -- made against Bangladesh in Dhaka last month -- before falling with 69 needed to win.
Ali set the victory tone by adding 46 for the first wicket with Sarfraz Ahmed (22), 85 for the third wicket with Asad Shafiq (39) and 56 for the next with Sohail.
Earlier Raza was in brilliant form as he lifted Zimbabwe with a flurry of boundaries, taking 59 in the last six overs.
This came after Chibhabha became the first Zimbabwean batsman to be dismissed for 99 in a one-day international.
Zimbabwe, forced to make four changes after their regular captain Elton Chigumbura was suspended for two matches over slow over rate in the previous game, were given a solid but slow start of 83 by Chibhabha and Vusi Sibanda (13).