Venkatsai Laxman hit 107 in India's 293 for seven from 50 overs, before young seamer Irfan Pathan grabbed 3-32 in 10 overs as Pakistan were bowled out for 253 at the Gaddafi stadium.
Pakistan, who at one point were reduced to 96 for six, had their pride restored by an aggressive 72 off 71 balls from Moin Khan.
The doughty wicket-keeper added 99 for the seventh wicket with Shoaib Malik (65) and 53 for the eighth with Mohammad Sami (23), but it was not enough to deny India victory.
India clinched the series 3-2 to record their first title win in Pakistan after five failed attempts between 1978 and 1997.
The Indians, who have also never won a Test match in Pakistan, will attempt to rectify that record when the three-Test series starts in Multan on Sunday.
Ganguly hurt his lower back when he dived to stop a drive from his Pakistani counterpart Inzamam-ul Haq and had to be taken off the field in a stretcher.
Indian manager Ratnakar Shetty said Ganguly was in "intense pain" while being treated in the dressing room by team physiotherapist Andrew Leipus.
"We will consult a specialist on Thursday morning so see how serious the injury is," media manager Amrit Mathur said. The Indian captain will have just three days to recover if he is to play in the first Test.
Laxman's sixth One-day hundred steadied the tourists after Inzamam won his fifth toss in a row and elected to field in the day-night game.
Laxman, who managed just 27 runs in three previous innings in the series, struck 11 boundaries before he holed out against off-spinner Malik.
India plundered 19 runs in the last two overs due to belligerent batting by tailenders Pathan (20 off 12 balls) and Laxmipathy Balaji (10 off six).
Among the 25,000 fans at the overflowing stadium was Pakistan President Pervez Musharraf, who watched the match for an hour alongside Indian industrialist Nusli Wadia, the grandson of Pakistan's founder Mohammad Ali Jinnah.
Mumbai-based Wadia was a special invitee of the Pakistan Government to the match, part of India's first full tour of the neighbours since 1989.
India's total was identical to Pakistan's in the fourth One-dayer at the same venue on Sunday, which the tourists surpassed with five overs to spare.
But Pakistan's hopes were dashed by left-arm seamer Pathan, who ripped through the top order to reduce the rivals to 58 for four by the 13th over.
Pathan trapped Yousuf Youhana leg-before for one, clean bowled Taufiq Umer and then had Younis Khan caught at point by Yuvraj Singh with a well-disguised slower ball.
At the other end, new-ball partner Balaji bowled Yasir Hameed and had danger man Abdul Razzaq driving to mid-off as Pakistan slipped to 96 for six.
Inzamam, who hit centuries in the first and fourth matches, managed only 38 when he was superbly caught by Sachin Tendulkar near the boundary ropes at long-on. It was Tendulkar's 100th catch in One-day Internationals.
Tendulkar, One-day cricket's most successful batsman, had earlier failed to make 50 for the sixth successive time in a major final when he was dismissed for 37.
Laxman was helped in the recovery by Ganguly, who made 45 in a third-wicket stand of 92.