Azam smashed a 117-ball 107 and also became the fastest batter to reach 5,000 ODI runs, as Pakistan made 334-6 in their 50 overs.
His 18th ODI hundred took him past the mark in his 97th innings in the format, beating former South Africa batter Hashim Amla’s previous record of 101 innings.
New Zealand were bowled out for 232 in 43.4 overs with skipper Tom Latham (60), Mark Chapman (46) and Daryl Mitchell (34) offering some resistance.
Leg-spinner Usama Mir led Pakistan’s bowling charge with a career-best 4-43 while pacers Mohammad Wasim (3-40) and Haris Rauf (2-37) also impressed.
The win gave Pakistan a 4-0 lead in the five-match series and took them to number one for the first time since the International Cricket Council officially recognised the rankings in 2005.
Pakistan’s previous highest ODI ranking was third which they attained in January 2018 and again in June 2022.
Azam starred with his 30th ton in all international cricket after New Zealand won the toss and put the hosts in to bat at National Stadium.
The 28-year-old beat Amla’s record when he reached 19.
He added 50 for the second wicket with Shan Masood (44), 127 for the fourth wicket with Agha Salman (58) and another 41 for the sixth with Iftikhar Ahmed who scored 28.
Azam, who has been the number one ODI batter for the last two years, hit 10 boundaries before he was caught at deep mid-wicket off debutant Ben Lister in the 48th over.
Azam is the 14th Pakistani to score 5,000 or more runs in ODI cricket, with former captain Inzamamul Haq top of the list with 11,701.
He is also the fastest to 18 ODI hundreds, beating Amla’s record of 102 innings.
Salman chipped in with two sixes and four fours in his 46-ball knock before being caught and bowled by pacer Matt Henry who finished with 3-65.
Shaheen Shah Afridi hit three sixes and a four in his seven-ball 23 not out as Pakistan plundered 94 runs in the last 10 overs.
Pakistan: Babar Azam (captain), Fakhar Zaman, Shaheen Shah Afridi, Shan Masood, Mohammad Haris, Iftikhar Ahmed, Mohammad Rizwan, Mohammad Wasim, Agha Salman, Usama Mir, Haris Rauf
New Zealand: Tom Latham (captain), Mark Chapman, Cole McConchie, Matt Henry, James Neesham, Blair Tickner, Ben Lister, Tom Blundell, Daryl Mitchell, Ish Sodhi, Will Young
Umpires: Asif Yaqoob (PAK) and Joel Wilson (WI)
TV umpire: Langton Rusere (ZIM) Match referee: Chris Broad (ENG)