Pakistan had lost the first two ODIs on their tour of India in 2005, but had pulled one back by winning the third.
The teams moved to Ahmedabad for the fourth game in the six-match series and India placed themselves in a strong position for an unbeatable 3-1 lead by opting to bat first and finishing with an imposing 315 for six in 48 overs.
Openers Virender Sehwag (29) and Sachin Tendulkar gave them a good start with a partnership of 65 runs and then Tendulkar and MS Dhoni (47) built upon this with a stand of 129 runs for the second wicket.
Tendulkar got 123 - his 38th ODI hundred - with the aid of 12 fours and two sixes.
Pakistan had never before successfully reached a 300-plus target in an ODI, but this time they were given a rollicking start with Shahid Afridi hitting 40 off just 23 balls.
The other opener Salman Butt got 48 and then the middle order made valuable contributions.
Abdul Razzaq scored 44 and Shoaib Malik 65 and the run rate was maintained by singles and twos rather than big hits.
The crowd of 50,000 were on their toes scenting an Indian victory, but Pakistan, with Inzamam controlling the innings, crept towards the target, even as wickets fell at the other end.
The skipper kept his cool in the heat and humidity.
The scores were level with seven wickets down as Tendulkar ambled up to bowl the last ball. Inzamam belted it through point to the boundary to level the series. His unbeaten 60 went on to turn the series on its head, and Pakistan duly won the next two matches to clinch a 4-2 win.