Spain now move top of Group A4, one point ahead of second-placed Ukraine. Germany are third on two points after they lost 1-0 to Switzerland.
Though it was clear that Djokovic had not intended to hit the line judge, organizers nevertheless said the Serbian was disqualified in accordance with the rules.
Emre Can (Front, L) of Germany vies with Alcantara Thiago of Spain during a UEFA Nations League match between Germany and Spain in Stuttgart, Germany, Sept. 3, 2020. (Xinhua)
Djokovic's exit means there will be a first-time Grand Slam champion in the men's draw, with Zverev among the contenders at Flushing Meadows.
Beijing Guoan's second-place position and Wuhan Zall's third position remain unchanged in Group B. Enditem
Briton Adam Yates retained the yellow jersey and kept a three-second lead over Jumbo's Primoz Roglic in the overall standings.
The six-time US Open champion will next face compatriot and 2017 champion Sloane Stephens.
After months of preparation, the ITTF announced the return of table tennis to the international arena and named it RESTART.
Kosgei was later disqualified for stepping onto the infield in the closing stages.
Playing in his second match for the Rio de Janeiro outfit, the 35-year-old combined with Rhuan Silveira before deftly sliding a shot past Cassio.
"This team have given me so much, my first chance, my first podium and my first win. It is just an amazing day."