The Clippers had grabbed a 115-113 lead with 6.2 seconds remaining on Matt Barnes' triple, but the Nuggets responded with an unlikely miracle shot.
The play began when Denver's J.J. Hickson couldn't execute a pick-and-roll at the top of the key with time ticking down.
Foye ran up to take ball and launched a 28-foot prayer with Blake Griffin guarding him tightly -- it sailed through the net for a win as the final horn sounded.
Kenneth Faried led Denver with a personal-best 28 points to go with 11 rebounds.
Ty Lawson added 27 for the Nuggets.
Griffin paced the Clippers with 36 points.
'How to Train Your Dragon 2' releases 5-minute clip
Yosemite climber falls 30 feet, suffers major injuries