Djokovic was playing his first competitive match since falling to top-ranked Carlos Alcaraz in the Wimbledon final.
The winner of a record 23 Grand Slam singles titles, Djokovic is set to open singles play Wednesday night against Alejandro Davidovich Fokina.
Alcaraz faced Australian qualifier Jordan Thompson in a late match. The defending US Open champion was in position to become the first ATP player to reach 50 wins this season.
In women’s play, former US Open champion Sloane Stephens reached the third round for the first time since 2019 with a 4-6, 6-4, 6-4 victory over sixth-seeded defending tournament champion Caroline Garcia.
Stephens, who won in New York in 2017, improved to 2-8 in her last 10 matches against top-10 players. Both of the wins have been against Garcia.
Fifth-seeded Ons Jabeur, in her first match since losing the Wimbledon final, overcame a 5-1 deficit in the third set to top Anhelina Kalinina 6-3, 6-7(2), 7-6(2).