Mahmood took three for 16 with the ball to reduce Kolkata to 137 for six.
The experienced campaigner then smashed a half century to steer his Auckland side to victory with 14 balls to spare.
Kolkata, who won the toss and elected to bat, were in trouble as early on when captain Gautam Gambhir edged Michael Bates to Martin Guptill, who took an incredible catch on the on-side, in the second over.
Fellow opener Manvinder Bisla (38) and New Zealander Brendon McCullum (40) steadied the ship but some tight bowling from Azhar kept the score down.
The seamer took three wickets, including back-to-back dismissals in the 10th over with Jacques Kallis edging to first slip and catching Manoj Tiwary off his own bowling, which meant the reigning Indian Premier League champions finished on 137 for six.
Auckland started well in reply with Lou Vincent hammering three fours and two sixes in his 11-ball 30.
Azhar then came to the crease, carrying with him the momentum from his impressive bowling display and Vincent's sparkling opening.
The 37-year-old cracked an unbeaten 51 from 42 balls to guide Auckland to victory with 14 balls to spare, while Anaru Kitchen (24) offered decent support.
Kolkata's bowlers struggled, with Lakshmipathy Balaji conceding 38 runs off his four overs while Pradeep Sangwan and Shakib Al Hasan were also expensive as the Knight Riders crashed to their second successive defeat.
- Gautam Gambhir