Malinga, who retired from Test cricket in 2011 and played his farewell one-day international in July, bowled Colin Munro in the first over of the New Zealand chase to equal Afridi's record of 98 wickets.
The 36-year-old then cleaned up Colin de Grandhomme, for 44, to achieve the feat in his 74th T20 match of his illustrious career.
Afridi, a leg-spinner who also captained Pakistan, played 99 T20 matches.
Malinga is a quick known for bowling yorkers with his slinging action, made his T20 debut against England in 2006.