Having taken out the world's top one-day worldwide side with a historic win over England on Sunday, the Scots were looking to complete a stunning double by toppling a Pakistan team rated as the top Twenty20 nation.
Before defeat to Scotland, England had won six bilateral one-day series in a row.
Ahead of Australia's one-day global meeting with England - their first competitive match since the scandal-ridden tour - Paine asked Eoin Morgan if the teams could have a pre-match handshake on the field.
But Safyaan Sharif sealed Scotland's victory with seven balls to spare dismissing last man Mark Wood to spark a pitch invasion by jubilant home fans.
"I'm absolutely happy with that, it doesn't bother me", said Morgan.
Scotland's total was their highest at this level, surpassing their 341 for nine against fellow non-Test nation Canada at Christchurch four years ago.
But having seen England beat Australia 4-1 in an ODI series Down Under earlier this year, captain Morgan was confident this loss would not do lasting damage to England's morale.
He will be up against Jonny Bairstow who is enjoying a rich vein of form and will be taking guard in the match after scoring three successive hundreds in this format.
Australia captain Tim Paine says his players will shake hands with their England rivals before Wednesday's clash at The Oval as the tourists aim to heal the wounds of their recent ball-tampering scandal.
Scotland head coach Grant Bradburn: "We're gutted, which is a great sign of where our team is at. I think it's going to be a good series".
"We set our stall out to be number one in the world and that's where we are, whether we were number one in this game or not, Scotland would still be delighted to win, it's not just because we are number one".
England were all out for 365 after Scotland made 5-371, their highest total in a one-day worldwide.
The recently ended World Cup Qualifiers 2018 saw West Indies and Afghanistan make it to the main draw of the World Cup 2019.