Spain’s Rahm, ranked second in the world behind Johnson, was in the right rough off the tee at the first playoff hole, the 18th at Olympia Fields near Chicago.
His second shot rolled to the back of the green, leaving him what could have been a tough two-putt for par.
“Never did I think I’d be making another 50-, 60-footer - couple of breaks in there, too - to end up winning it,” said Rahm, who gave a roaring fist pump as the putt dropped.
Johnson’s tee shot was also off course, but ricocheted off a tree to settle in the fairway. The American found the middle of the green, but after Rahm’s miraculous birdie effort, Johnson’s birdie attempt settled inches from the cup.
Johnson had snaked in a 43-foot birdie at the same hole to force the playoff, joining Rahm on four-under par 276 in the second event of the US tour’s FedEx Cup playoffs.
Rahm had powered to the top of the leaderboard with six birdies in an impressive six-under par 64 - the lowest round of the week.
Johnson, seeking a second straight win and 23rd tour title, started the day tied for the lead with Hideki Matsuyama with Rahm three adrift.
He birdied three of his first four holes, but bogeys at eight and 10 saw him fall out of the lead before he picked up strokes at 15 and 18 to sign for a three-under 67.
Johnson’s solo second place means he’ll stay atop the rankings.
Rahm was tied for sixth starting the day after a third round marred by a bad mistake at the fifth hole, where he absentmindedly picked up his ball on the green without marking it and was assessed a penalty.
He said it wasn’t hard to put the blunder behind him.
“Once I teed off today, in the good weather and how I started striping it the first few holes, I knew I had a chance,” said Rahm, who claimed his fifth tour title and his second in his last five starts.
Rahm had two birdies on the front side, but picked up the pace with a 16-foot birdie putt at the 10th. He followed that with a five-foot birdie at the 12th and a nine-footer at 15 before he rolled in a 30-foot birdie at 16.
He wasn’t surprised, however, to find himself in a playoff, and went straight to the range to keep warm with Johnson still on the course and just one back.
“Knowing DJ and how good he has been playing, I expected nothing else,” Rahm said.
Rising Chilean star Joaquin Niemann got off to a hot start with three birdies in his first five holes. A birdie at the eighth gave him a share of the lead, but he slowed with a bogey at 14 and finished with a 67 that left him tied for third on 278 alongside Matsuyama, who signed for a 69.
American Tony Finau was alone in fifth after a 65 for 279.