A Pakistan fifth-wicket record stand of 162 between captain Inzamam-ul-Haq (72) and Yousuf Youhana (88) rescued the team from the depths of 66 for four and turned what had been an Australian stroll into an exciting match on Saturday.
Pakistan, chasing 270, finished on 259 all out with 10 balls left in what was a one-off, warm-up match for the ICC Champions Trophy which starts in England on Friday.
Australia's total of 269 for six was built on Andrew Symonds's superb 104 not out.
Fast bowler Michael Kasprowicz then pegged Pakistan back in the field with five for 47.
"It was pretty pleasing," said Australia captain Ricky Ponting.
"Andrew played a fantastic innings again and got us a total that was a few more than we should have got. We were going to be happy with around 250."
Victory was Australia's second against Pakistan in as many weeks after a 17-run win in the Dutch triangular final in Amstelveen.
But Ponting said Saturday's match had been the more valuable game.
"To play in conditions very similar to what we are going to be experiencing in the next few weeks was great. It was a better standard of game. It was a fantastic game of cricket. We just did enough at the end to clinch it. It was almost the perfect hit-out for us."
In 1999, Australia beat Pakistan at Lord's by eight wickets to win the World Cup final and two years later they won by nine-wickets in the triangular series final.
But it might have been a different story on Saturday had not Symonds been dropped on 24 and 82.
"I had a bit of luck," said the Man of the Match.
"I've played a number of County games at Lord's but this was my first hundred and to get one at the home of cricket was very special."
Meanwhile, Pakistan coach Bob Woolmer said his team required a batsman who could see them home.
"We need to find a finisher, especially when we are batting second. But we are getting close."
And of Symonds's innings, a rueful Woolmer added: "I wish they could catch him, then we wouldn't have to worry about a hundred. But he's a fine player ... a real gladiator."
An Australia win looked all but certain when opener Yasir Hameed fell for an elegant 47. However, Inzamam and Youhana gave Pakistan hope.
They entered the final 10 overs needing 77 to win, with batting to come before Youhana launched off-spinner Symonds for six into the Pavilion.
But two balls later Symonds had Inzamam caught at extra cover by Watson to end an 85-ball innings with five boundaries.
And then Youhana holed out to Watson at mid-off against Kasprowicz, having faced 98 balls with two sixes and three fours in his score of 88.
Pakistan lost their last six wickets for 31 runs in 22 balls with Kasprowicz ending the game by bowling Mohammad Sami for 10 one ball after the fast bowler had hit him for six.
Earlier Symonds, dropped on 24 and 82, faced just 103 balls with one six and nine fours.
It was his second One-day International hundred, the first a dynamic, match-winning 143 not out against Pakistan in Johannesburg at the World Cup last year.
Australia were 148 for five off 34 overs when Symonds and Michael Clarke, who made a run-a-ball 31, came together and put on 88 to revive the innings.
At The Wanderers last year Australia were 86 for four when Symonds came to the crease and and they were precariously placed at 99 for three when he arrived in the middle on Saturday.
He was first dropped when Rana Naveed, sliding in on his knees from long-on, failed to hold a catch off Shoaib Malik.
Symonds was missed again when a cut to third man off Shoaib Akhtar, whose eight overs cost 70 runs, was dropped by Youhana.
He hooked the first ball off the last over, from Akhtar, for six and two balls later stepped outside his leg-stump to cut a four to go to 99 before a two took him to his hundred.