Thompson had held a share of the lead heading into Sunday's final round with Richy Werenski, two shots clear of South Africa's Charl Schwartzel and Tony Finau.
It was Long, though, who continued his momentum from an eight-under-par third round to challenge at the top of the leaderboard as he signed for a 64 which put him at 17-under – and could have been lower but for a bogey at the second last.
Thompson, however, kept his nerve to land a superb bunker shot to within three feet of the 16th pin and rolled in a key birdie.
The American then picked up another shot at the last from 14 feet to card a 67 and finish at 19-under for the tournament, securing only his second PGA Tour win of his career and first since 2013.
An emotional Thompson choked back tears as he reflected on his second PGA Tour win, seven years after his first.
"I don't know what to say – this is so exciting," the 35-year-old told CBS.
"I just played such good golf today and stayed within myself, believed in myself. I couldn't have asked for anything more."
Former Masters champion Schwartzel and Werenski – who had dropped three shots on the front nine – finished in a group of nine players at 16-under-par following their respective rounds of 68 and 70.
Finau, the world number 17, birdied the 18th hole in his round of 68 to join Schwartzel and Werenski amid a nine-way tie for third.
Sweden's Alex Noren, Charles Howell III and Argentinian Emiliano Grillo were also at 16 under, alongside Robby Shelton, who carded a 64 to climb up the leaderboard, Max Holma and Cameron Tringale.
England's Tom Lewis, the only Briton to make the cut, shot a final round of 68 to finish at 10 under in a tie for 32nd place.