Ganguly top-scored with a watchful 88 and Sehwag smashed a quickfire 52 in the day-night game to boost their team's hopes of wrapping up the three-match series. Asia won the opening match by 34 runs in Bangalore on Wednesday.
They were not the only batsmen among the runs as Mohammad Yousuf (51), skipper Mahela Jayawardene (45), wicket-keeper Mahendra Dhoni (33) and Yuvraj Singh (30 not out) also made important contributions after their team had elected to bat on a good track.
Jayawardene also became the fifth Sri Lankan to complete 7,000 runs in one-day internationals during his 40-ball innings after Sanath Jayasuriya, Aravinda de Silva, Marvan Atapattu and Arjuna Ranatunga.
Pakistan's Yousuf hit two sixes and three fours in his second successive half-century, having top-scored with 66 in the previous match.
Sehwag set the pace when he hammered Albie Morkel for three fours in the opening over. He fell immediately after completing his half-century with a six off Elton Chigumbura. He hit a six and eight fours in his 38-ball knock.
But there was no respite for the African bowlers as Dhoni, Yousuf, Ganguly and Jayawardene maintained the impressive run-rate with their sensible knocks.
Left-handed Ganguly put on 80 for the fourth wicket with Jayawardene and 84 with Yousuf before falling in the closing overs. The former India captain struck a six and nine fours in his 112-ball innings.
South African seamer Morne Morkel took two wickets and his brother Albie one. Other wicket-takers were Zimbabwean Chigumbura (2-84) and Kenyan Thomas Odoyo (1-60).
The third and final one-dayer will be played here on Sunday.
Fall of wickets: 1-37 (Jayasuriya), 2-77 (Sehwag), 3-134 (Dhoni), 4-214 (Jayawardene), 5-298 (Ganguly), 6-331 (Yousuf), 7-333 (Rafique).
Umpires: Tony Hill (NZL) and Peter Parker (AUS)
TV umpire: Suresh Shastri (IND)
Match referee: Chris Broad (ENG)