Australia thus won the high-scoring series by 4-1 margin.
Chasing a steep target of 331, India's batting rode on Pandey's maiden ODI ton and a superb opening stand of 123 between Rohit Sharma (99) and Shikhar Dhawan (78) to overhaul the score with just two balls to spare, setting up the record for the highest run chase against the home team on Australian soil.
The visitors, after cruising along nicely at one stage, were left to pick 13 of the last over which was bowled by Mitchell Marsh. He bowled the first delivery wide as the equation came down to 12 off six balls.
Skipper Dhoni, who was struggling to middle the ball throughout the entire innings cleared the fence off a low full-toss bowled by Marsh but was out off the very next delivery leaving a tricky six runs to be scored off 4 deliveries.
Also Read
The win was accomplished when Pandey hit over extra cover region as vice-captain Virat Kohli rushed to the field to congratulate him.
Pandey, hit eight fours and a six in his 81 ball knock.
(REOPENS FGN 9)
While Pandey was adjudged Man of the Match, Rohit, who has been in sublime form throughout the series was fittingly awarded Man of the Series for his 441 runs in five matches with a staggering average of 110.25 that included two hundreds, which could have easily been three as he missed it by a whisker.
While chasing 331, India got off to a flying start thanks to Dhawan, whose 78 runs came off 56 balls and was laced with 7 fours and 3 sixes. This was his 17th ODI fifty.
He came out all guns blazing and put up 123 runs for the first wicket with Rohit Sharma, who hit nine fours and a six with the team 50 coming up in only the 8th over.
Everything seemed to be going great guns for the two openers, when Shaun Marsh plucked out a stunning diving catch at deep point dismissing Dhawan off John Hastings (3-61) in the 19th over, the batsman at fault of taking too many chances.
Two overs later, it became a double blow as Hastings had Virat Kohli (8) caught behind for his first single digit score in the series. It was then Rohit and Pandey were united, and they batted calmly, cutting down risk while making sure that the run-rate didn't get out of hand.
Their 50-partnership came run-a-ball and India went past the 200-mark in the 31st over. In doing so, Rohit crossed the 400-mark personally in this series, as also 5000 ODI runs, and looked set for his third hundred in five games when Shaun Marsh dropped a sitter off Nathan Lyon (0-58) in the 33rd over.
Their 50-partnership came up off 57 balls thereafter, but
Dhoni survived a close LBW shout against James Faulkner (0-54) in the 45th over.
With 40 runs needed off the last four overs, Faulkner and Mitchell Marsh (1-77) bowled tight lines at the death, not giving the batsmen any chance to free their arms.
The required-rate went up as a result but the runs came in a trickle, even as the 300-mark came up in the 48th over. Apart from the odd boundary, the big shots didn't come until the last over, when with 13 needed, Dhoni hit a six and then was caught at long off next ball.
Earlier, David Warner scored 122 runs (113 balls, 9 fours, 3 sixes), his 5th ODI ton, while Mitchell Marsh finished with 102* (84 balls, 9 fours, 2 sixes), his maiden ODI hundred as Australia finished at 330/7 (50 overs).
Warner and Aaron Finch (6) got the proceedings underway then, with Indian bowlers getting on top for the first time since the Perth ODI as Ishant Sharma (2-60) trapped Finch LBW in the very first over.
Steve Smith (28) put on 58 runs for the 2nd wicket with Warner quickly even as Bumrah (2-40) was introduced into the attack in the 8th over and then Rishi Dhawan (1-74) was brought on in the 11th over.
At the other end, Dhawan got rid of George Bailey (6) in the 15th over as Australia were under considerable pressure at that stage. 78/3 became 117/4 in the 22nd over, as Shaun Marsh (7) was run-out, the ball deflecting off Gurkeerat Mann (0-17).
But Mitchell Marsh then joined Warner in the middle, and the duo added 118 runs for the 5th wicket to lift Australia from the hole they were in. In fact they did not curb their free scoring as the run-rate continued unabated with the 200-mark coming up in the 34th over, even as Warner had reached his century off 100 balls in the 36th over. While Ravindra Jadeja (0-46) bowled with control, Umesh Yadav (1-82) proved to be expensive once again.
Both Wade and James Faulkner (1) were dismissed in the death overs in a bid to accelerate further, but Marsh stayed put long enough to score his maiden international hundred off 81 balls in the final over of the innings.
In doing so he joined his father Goeff Marsh and brother Shaun, both of whom had also scored their maiden ODI hundreds against India as well.