Federer won the men’s singles title at Roland Garros in 2009, while Djokovic lifted the trophy in 2016
Federer, who is competing at a Grand Slam for the first time since the Australian Open in January 2020, had a difficult second-round draw against old foe Marin Cilic but emerged a 6-2 2-6 7-6(4) 6-2 winner.
Federer, 39, defeated Cilic in the 2017 Wimbledon and 2018 Australian Open finals, and the former world No 1 achieved another big win against the Croat on Court Philippe Chatrier on Thursday.
There was some tension on the clay in Paris as Federer received a time-violation warning from the umpire in the second set, though tempers soon cooled.
Federer even overruled the umpire at the start of the third-set tiebreak, awarding Cilic a point after the 2014 US Open champion had a serve incorrectly called out.
Federer’s victory sets up a third-round meeting with Dominik Koepfer of Germany.
Djokovic, meanwhile, cruised past Pablo Cuevas in straight sets, 6-3 6-2 6-4.
The world No 1 needed a little over two hours to see off the Uruguayan and will next take on Lithuania’s Ricardas Berankis.
Djokovic is bidding for his second title at Roland Garros, having lifted the trophy in 2016, while Federer won the men’s singles at the French Open in 2009.
Federer’s 2009 title sealed a long-awaited career Grand Slam, while Djokovic’s triumph in 2016 did the same for the Serb.