He was brilliantly backed by paceman Praveen Kumar (3-34).
But India skipped a few heartbeats before achieving the modest target with more than 10 overs to spare to level the five-match series 1-1.
They were wobbling at 75-5 after seamers Thilan Thushara and Nuwan Kulasekara shared four wickets, but skipper Dhoni and debutant Subramaniam Badrinath (27 not out) held their nerve under pressure.
When Dhoni inside-edged paceman Dilhara Fernando's delivery on to his stumps, his team were just eight runs short of the win with four wickets in hand.
buy nolvadex online buy nolvadex online no prescription
"Zaheer did the job for us as he bowled in right areas. Credit also goes to Badrinath as he had not played Sri Lankan spinners Ajantha Mendis and Muttiah Muralitharan before," said Dhoni.
"We needed this victory. There was pressure on us, especially after losing opener Gautam Gambhir (stif