The top-seeded Serbian, who has claimed four of the last five grand slam titles, took some time to settle in to his first career meeting with Carballes Baena but after a tight first set was off to the races.
Djokovic, bidding for a 17th grand slam title, got an early break to go ahead 2-0 in the second set and never looked back as the three-times champion used a mix of deft volleys, solid movement and great instincts to secure the win.
Up next for Djokovic will be either American Sam Querrey or Argentine Juan Ignacio Londero.
French Open champion Ash Barty survived a first-round scare, staving off Kazakhstan's Zarina Diyas 1-6 6-3 6-2 after struggling to find her footing as the action kicked off at Arthur Ashe Stadium.
The 25-year-old Diyas took five straight games in the first set, as the world No.2 committed a string of unforced errors and got in just 25% of her first serves.
Barty was able to stop the pain midway through the second set, converting on a crucial break-point opportunity to take a 5-3 lead and reverse the momentum in what had been a one-sided match.
The 23-year-old Australian, who reached the fourth round here last year, appeared to be back on form by the third set, getting in nearly two-thirds of her first serves and firing off 12 winners.
Barty skyrocketed to fame in June when she became the first Australian woman in 46 years to win the French Open singles title.
Kristina Mladenovic of France upset former world number one Angelique Kerber 7-5 0-6 6-4 to put an early end to the 2016 U.S. Open champion's bid for a second trophy at Flushing Meadows.