Describing it as the finest T20 innings of his career, the India legend finished unbeaten on 82 from 53 balls but was stuck at the non-striker's end in a surreal finish to the match.
When Mohammad Nawaz removed Pandya for 40 off 37 balls with the first ball of the final over, India still needed 16 runs for victory. But the Pakistan spinner then lost his nerve.
Kohli struck a six from a no-ball on the fourth ball of the over and Nawaz then bowled a wide. He then bowled Kohli, who had the benefit of a free hit courtesy of the wide.
Alert to the ball ricocheting from the stumps, the Indian batters ran three byes to reduce the target to two runs off two balls. But that left Kohli off strike.
Nawaz had Dinesh Karthik stumped with the second last ball, but then bowled another wide, leaving Ravichandran Ashwin needing only a single to secure victory for India.
"It's a surreal atmosphere. I honestly have no words. I have no idea how that happened," Kohli said.
After sending their rivals in, India placed Pakistan under significant pressure when removing star batter Mohammad Rizwan and captain Babar Azam in the first four overs.
Pakistan struggled to find rhythm in overcast conditions until a surge from Iftikhar Ahmed midway through their innings helped them to a competitive tally.
Ahmed made 51 from 34 balls, at one stage striking four sixes in six balls, with three of them coming from off-spinner Axar Patel. He was well supported by Shan Masood, who finished unbeaten on 52 from 42 balls.
India faltered early in their chase courtesy of a combination of brilliant bowling, poor shots and misjudged running.
After India fell to 31-4 when Axar Patel was judged run out in a contentious decision, Kohli and Pandya set about resurrecting their nation's hopes.
The pair, who combined for a partnership of 113, worked the ball around the spacious MCG and brought up India's 100 with five overs remaining. This left India requiring 60 from 30 balls.
India's captain Rohit Sharma said that after losing early wickets, the key was trying to stay in the match for as long as possible. With Kohli at the crease, he still had belief.
"From the situation we were in, it has to be one of India's best knocks, not just his best knock," he said.
His Pakistan counterpart Azam was stunned after the loss but paid tribute to Kohli, the man of the match.
Earlier, Sri Lanka secured victory with five overs to spare against Ireland in both teams' Twenty20 World Cup Super 12 opener.
After Ireland had won the toss and chose to bat first in overcast and wintry conditions at Bellerive Oval, Sri Lanka's bowlers made regular breakthroughs to restrict the Irish to 128-8 after its 20 overs.
Chasing 129 for victory never proved a difficult challenge for Sri Lanka, which chased down the below-par target with ease.
Kusal Mendis top scored with 68 off 43 balls, with five boundaries and three sixes, including hitting a six to win the match off the final ball of the 15th over.
Sri Lanka raced to 50 without loss at the end of their 6-over power play with Mendis and Dhananjaya de Silva removing any nervousness Sri Lanka may have had chasing a low target.
Spinner Gareth Delaney had Dhananjaya caught behind for 31 in the ninth over. But that was a brief respite as Charith Asalanka made a brisk 31 off 22 balls as part of a 70-run partnership with Mendis to close-out an impressive victory for Sri Lanka.
Paul Stirling (34 ) and Harry Tector (45) top scored for Ireland and were the only two batters to get some momentum in their innings as too many of their teammates played poor shots and gave their wickets away cheaply to prevent a more competitive total being reached.
Captain Andrew Balbirnie (one) and Locran Tucker (10), two of Ireland's heroes in a famous win against two-time champions the West Indies on Friday to qualify for the Super 12 stage, were both bowled around their legs shuffling across the crease.
Ireland's innings never really recovered from that slow start as spinners Maheesh Theekshana (2-19 from four overs) and Wanindu Hasaranga (2-25 from four overs) took two wickets apiece to keep Sri Lanka in control.
Theekshana bowled Lorcan Tucker inside the powerplay overs before returning late to remove George Dockrell and break a 47-run partnership between Dockrell and Harry Tector, who top scored with 45 from 42.
Both teams qualified for the Super 12 stage through a dramatic qualifying round that was played over six days.
Ireland crushed two-time defending champion the West Indies by nine wickets on Friday to clinch its spot in Group 1 of the second stage behind Zimbabwe.
Sri Lanka, which won its maiden Twenty20 World Cup in 2014, had a poor start to its qualifying round losing to Namibia, but responded with victories over the United Arab Emirates and the Netherlands to stay alive in the tournament.
Sri Lanka and Ireland are joined by Australia, New Zealand, England and Afghanistan in Group 1 for the second round. New Zealand thrashed defending champion Australia by 89 runs, and England eased past Afghanistan by five wickets on Saturday to commence the Super 12 stage.