American Johnson conjured some magic of his own on the green with a 43 foot putt on the 18th taking him level with his Spanish opponent on four under.
It could have been a different story had Rahm not incurred a penalty shot in his third round for a marking error, but he made up for it with a final round of 64 completing a miraculous turnaround after finishing Thursday tied for 51st place.
Rahm picked up two shots on the front nine and birdied the 15th and 16th for a final round some 11 shots better than his first.
Johnson, who took the world No 1 ranking from Rahm with his stunning 30-under-par victory in Boston a week earlier, dropped shots on the eighth and 10th before his nervy putt at the last.
Needing a birdie to force a play-off, Johnson found the pin on the undulating green as the pair were forced to play the 18th again.
There, Rahm played perfectly from 66 feet as he and Johnson watched as the ball curved into the hole for a birdie three and his fifth win on the tour.
Speaking to the Golf Channel about Johnson's putt at the 18th, Rahm said: "Knowing DJ and how good he has been playing, I expected nothing else.
"I was fully confident it was going to come into a playoff and hoping to win it.
"Never did I think I would make another 50, 60-footer, a couple of breaks in there, to end up winning it."