
The Serbian pair fell to a 7-6(7/4), 7-5 loss to Russians Elena Vesnina and Aslan Karatsev.
World No 1 Djokovic had earlier seen his Golden Grand Slam bid ended by a singles semifinal defeat by Alexander Zverev.
Djokovic needed Olympic singles gold and the US Open title to secure the Golden Slam after winning the first three Grand Slam events of the season.
Karatsev and Vesnina will face Anastasia Pavlyuchenkova and Andrey Rublev in an all-Russian final on Sunday after their compatriots beat women’s world No 1 Ashleigh Barty and John Peers in the first semifinal.
A tight first set was taken on a tie-break by Vesnina and Karatsev, but Djokovic and Stojanovic looked poised to force a deciding breaker after moving 4-2 ahead in the second.
But Stojanovic was broken in the eighth game and then again, to love, in game 12, with Djokovic bunting a difficult volley long on the first match point.
The 34-year-old Djokovic, who won singles bronze in 2008, will play two bronze-medal matches tomorrow, against Pablo Carreno Busta in the singles before he and Stojanovic take on Australia’s Barty and Peers.