Top seed Djokovic, who saved two match points in the All England Club final to deny Federer a record ninth title at the grasscourt championships, will start his campaign against 76th-ranked Roberto Carballes Baena in New York next week, Reuters reported.
The Serbian then faces a potential second-round showdown against American Sam Querrey.
Third seed Federer, who won the last of his five Flushing Meadows trophies in 2008, will open against a qualifier as he chases a 21st Grand Slam title.
Djokovic has a 26-22 head-to-record record against Federer, and has won their last four meetings.
They are 3-3 at Flushing Meadows, with Djokovic winning the last three times, most recently in the 2015 final.
On the other side of the draw, second seed Rafael Nadal, who was beaten by Federer in the Wimbledon semifinals, will play Australian John Millman in the first round of the hardcourt major which starts on Monday.
The Spaniard, three-times a champion in New York, could run into 2014 champion Marin Cilic in the fourth round.
Djokovic says he is ready for another Grand Slam tilt, almost two months after claiming his 16th title at Wimbledon.
Speaking at the draw on Thursday, he said the Wimbledon final against Federer was one of the two most memorable matches of his career, along with the six-hour marathon against he won against Nadal in the 2012 Australian Open final.
“It took me time to reflect on everything, relax... and then get back on track,” he said of Wimbledon.
Serena Williams will begin her quest for a seventh US Open title and record-tying 24th Grand Slam victory against long-time rival Maria Sharapova in the US Open women's singles.
Williams has dominated the Russian star in their head-to-head rivalry, winning 19 times with only two defeats, including their past 18 meetings, most recently at the 2016 Australian Open quarterfinals, although Sharapova advanced by walkover against Williams in the fourth round at Roland Garros last year, AFP wrote.
Eighth-ranked Williams is looking to match the all-time record of 24 Grand Slam singles titles won by Margaret Court when the year's final major championship gets under way.
Serena was placed into the same quarter as Australian second seed Ashleigh Barty, the reigning French Open champion whose first match is against 77th-ranked Zarina Diyas of Kazakhstan.
Top-seeded Naomi Osaka opens against Russia's 93rd-ranked Anna Blinkova and could face a third-round date against 15-year-old American Coco Gauff, who eliminated Venus Williams in the first round at Wimbledon in a run to the last 16 in her Grand Slam debut.
Romania's fourth-seeded Simona Halep, coming off her second Grand Slam title – in Wimbledon – opens against a qualifier and could face a semifinal against Osaka, who defends a Slam crown for the first time.