Sousa arrived at the season's final Grand Slam in terrible form having lost his last seven matches but suddenly found his game on the Flushing Meadows hardcourts knocking off two seeded players, number 12 Pablo Carreno Busta and number 17 Lucas Pouille, on route to the last 16.
Wimbledon champion Djokovic will play Federer in the last eight if the Swiss can beat Australia's John Millman.
Millman will move on to the quarterfinals to face Novak Djokovic, who did his part Monday as he punched his ticket with a 6-3, 6-4, 6-3 win over unseeded Joao Sosa.
Madison Keys had to work on Labor Day, but not too hard, cruising into the US Open quarterfinals - two wins shy of matching her finals appearance a year ago.
The heat proved more of a problem for Novak Djokovic than his rival.
He reached the quarterfinals for an 11th consecutive appearance in NY as he bids for a third U.S. Open championship and 14th Grand Slam trophy.
"It was much more hard than the score indicated", Djokovic said.
Keys started the match by holding in the first game and then doubled her lead after a 14-minute game that featured four game points for Cibulkova, who was baking on the sunny side of the court, and five break points for the American.
"Joao brought a lot of intensity on the court".
Kei Nishikori, runner-up in 2014, was also pleased to get through in three sets in blazing sunshine on Louis Armstrong Stadium.
"I'm not 21 anymore, I still don't feel old but at same time there is a little biological clock that's not in your favour".
"Man, really lucky to finish in three sets", Nishikori said.
The 13-time Grand Slam victor had made easy work of the opening set, breaking Sousa twice, the second time to close out set.
Nishikori missed the US Open past year because of a right wrist injury.
Should 20-time major victor Federer get through against the 55th-ranked Australian, he'll set up his earliest Grand Slam meeting with Djokovic since 2007, when Federer beat the Serb star to reach the Australian Open quarter- finals.
Seventh-seeded Cilic, who survived a five-set marathon against Australian teenager Alex de Minaur that went into the early hours of Sunday morning, faced 10th-ranked Belgian David Goffin later Monday.