The 35-year-old Australian managed to get up-and-down for par after his approach shot nestled inches away from the left-side pond at the finishing hole of the difficult Blue Monster course at Trump National Doral Resort.
His three-under-par 69 left Scott with a 12-under total of 276 and a one-shot win over double Masters winner Bubba Watson, who carded a final-round 68.
"I was so lucky for it to stay up inside the hazard line," Scott told NBC Sports. "When you get lucky, you better get up and down."
Lowry hits out at 'idiots' in Ryder Cup crowd
At the 18th, Scott hit his tee shot in the right rough, seven feet behind a palm tree that was in his direct line to the green. Scott missed the green left, but was fortunate when his ball stayed out of the water, just inside the hazard line.
"I had to aim because the tree was in my line to go to the green," he said. "I thought the wind was strong enough so it would cut, but it just didn't cut at all."
Scott, who won the Honda Classic last Sunday, began the final round three shots behind leader Rory McIlroy and fell six strokes off the pace making two double bogeys in the first five holes.
The red-hot Australian, however, responded with a run of six birdies in the next nine holes.
"Everything fell the right way for me today, especially on 18 for that ball to stay up," said Scott.
Besides increasing his PGA Tour haul to 13 career wins, Scott also has a second-place finish in his past three events and will move to world number six on Monday.
"You have to push yourself so hard to beat the class of players that is out here right now," Scott said. "So I can't believe I won back-to-back weeks. To win a world championship event is huge. I'm going to push hard the next few weeks."
Watson finished second for the third time at Doral, but any disappointment might be mitigated by the fact that his runner-up showings in 2012 and 2014 were followed by wins at the Masters.
World number three McIlroy, who briefly chatted with Republican presidential candidate and Doral owner Donald Trump on the practice range before the final round, failed to get on track.
He made three bogeys before his first birdie at the short par-4 16th. A 74 left the Northern Irishman in a tie for third with Englishman Danny Willett, who shot a 69.
American Phil Mickelson bogeyed the final hole to finish alone in fifth on 279 after a 70.
'I hate this tournament!' - Team Europe emotional after the Ryder Cup loss
'Unfinished business' - Spieth already targeting 2023 win with Team USA