Mahmood grabbed 3-25 after chipping in with a useful 18 runs as Punjab scored 156/8 and then restricted Chennai to 149/8 on a slow Chidambaram Stadium pitch.
Mahmood removed openers Faf du Plessis (29) and Subramaniam Badrinath (25) in successive overs and came back to dismiss the dangerous Albie Morkel in the final over to clinch the game for Punjab.
Mahmood's effort was backed up by legspinner Piyush Chawla, who accounted for Suresh Raina and Ravindra Jadeja to destabilise the mid-innings.
West Indian all-rounder Dwayne Bravo, who had bagged two wickets earlier in the day, gave a glimmer of hope with a knock of 30 but holed out in the deep off Praveen Kumar.
Earlier, South African Morkel helped restrict Punjab despite a strong start by the visiting team.
Morkel took 3-29 including the important wickets of compatriot David Miller (19) and Australian David Hussey (7) as Punjab slipped from 127/2 in the 16th over.
Opener Mandeep Singh was the highest scorer with 56 off 50 balls with one six and five fours. Australian Shaun Marsh chipped in with a crisp 32 off 22 before he was run out backing up too far as a straight drive from Singh went on to the stumps off Ashwin's shoe.
Mahmood chipped in with 18, including two sixes off consecutive balls from Jadeja, before he was bowled by Bravo.
Punjab are only above bottom-place Deccan Chargers in the nine-team league with four wins and five losses from nine games. Chennai are currently third with four wins, four losses and an abandoned game.