Sohaib hit nine fours and two sixes during a 90-ball knock as Pakistan recovered from 8-2 and the loss of regular wickets to chase down Bangladesh???s 246 all out with 11 balls to spare.
Seamer Mohammed Irfan had earlier taken five wickets for Pakistan, who will conclude their World Cup preparations with a match versus England, also in Sydney, on Wednesday.
Pakistan made quick headway after losing the toss and being asked to bowl by Bangladesh, with Anamul Haque (0) and Mominul Haque (7) back in the pavilion with just 16 on the board.
But a 168-run partnership for the third wicket between Mahmudullah (83) and Tamim Iqbal (81) stabilised the Tigers??? innings, before the batsmen fell in the 39th and 40th overs respectively.
Mushfiqur Rahim???s first-ball duck saw Bangladesh lose three wickets for six runs and they then shipped their last five for 15 runs after Shakib Al Hasan (31 off 30 balls) had played a sharp cameo.
Irfan was the pick of Pakistan???s bowlers, with his 5-52 including the final four Bangladesh wickets, three of which came in his last over, but leg spinner Yasir Shah (2-42) also chipped in with two scalps.
Bangladesh???s attack wasted little time getting stuck into Pakistan???s batters, though, with Rubel Hossain removing Sarfraz Ahmed (1) and Mashrafe Mortaza dismissing Ahmed Shehzad (5), Anamul Haque the catcher on both occasions.
Younis Khan (25) and Haris Sohail (39) subsequently joined forces and put on 44 for the third wicket, before Sohail and Sohaib Maqsood added 51 for the fourth, and Maqsood and Umar Akmal (39) combined to swell the score by a further 63 runs.
Captain Misbah-ul-Haq made just 10 but Maqsood continued to anchor the innings and found another ally in Shahid Afridi, who announced in December that he will require from ODI cricket after the World Cup.
Afridi plundered 24 off 20 balls during a quick-fire partnership of 41 with Maqsood and even though he was caught out off Al Hasan, Maqsoob took Pakistan over the line.