The 19-year-old upset the natural order by winning the first set of their opening round clash, before doubling down to win the fourth. But ultimately Federer's skill and experience won out over the course of the two-hour, 37-minute encounter.
He showed signs of a fightback by winning the fourth set, breaking Federer's serve to go up 3-1, but it was too little, too late for the American.
The Maryland native's first set win marked an improvement on the only other time the two have met on court, when he pushed Federer to a first-set tiebreak at the Miami Open in March.
Federer's win furthers anticipation that he'll meet his old rival, Rafael Nadal on the hard courts of Arthur Ashe stadium. The two are on course for a semifinal encounter after the Spaniard dismissed Dusan Lajovic 7-6 (8-6), 6-2, 6-2 in his opening fixture.
While Federer avoided an ignominious early exit, day two did see a major upset as women's defending champ Angelique Kerber was dismissed by Japan's Naomi Osaka in straight sets, 6-3, 6-1. It's only the third time a defending champion has exited the US Open
in the first round.
The late-night crowd grew ever-more vocal as the match wore on, cheering on the young American as he snatched points from Federer. He broke Federer's serve late in the fifth set to raucous applause, denying him a match winner.
But it was not to be, although on the strength of this hard-fought match, his will be a career to follow.
Reportedly a quiet, thoughtful teen, Tiafoe credits much of his development to his father, Constant Tiafoe, an immigrant from Sierra Leone.
The elder Tiafoe helped build, and later became the custodian of, the Junior Tennis Champions Center in College Park, Maryland, where Frances has trained since he was a child.
While working around the clock, his father was forced to move into a vacant storage room at the tennis center, where his two boys would stay with him, sleeping on a massage table, while their mother worked night shifts as a nurse.
"Obviously, I wasn't the wealthy kid, or wasn't having all the new stuff or whatever. But I was just living life. I could play tennis for free, the sport I loved," he told CNN in 2015
At just 15 years old, Tiafoe won the prestigious Orange Bowl, becoming the youngest boys' singles champion in the tournament's history -- a remarkable feat considering the list of previous champions, which includes Roger Federer, Andy Roddick, Ivan Lendl, Jim Courier, John McEnroe and Bjorn Borg.
While many junior prodigies have come and gone, Tiafoe's unique background and work ethic set him apart from the rest. He said of his parents, "with them trying so hard, I felt like I didn't want to let them down. I felt like I didn't want to let the opportunities go for granted."
Tiafoe turned pro in 2015, signing as the first tennis player at Jay Z's Roc Nation Sports agency.
"Obviously, Jay Z definitely got my attention," Tiafoe told the New York Times
in 2015. "I thought it was pretty cool that he wanted me on the team."
The US hasn't produced a men's singles champion at the majors since Andy Roddick in 2003, and many fans and sportswriters are hoping that the young Tiafoe can build on his remarkable five-set loss to take up the mantle.
"What a night for Tiafoe. Faces a legend, giant crowd, plays so well, heart, guts, comeback, whole deal. Great show," tweeted the Wall Street Journal's Jason Gay.
"Hopefully this (loss) propels him," added USA Today's Dan Wolken. "America needs a tennis star."
'More than a test'
Federer praised his opponent's game and acknowledged that Tiafoe had caused him trouble.
"It was more than a test, it was a good one. I think we both enjoyed ourselves out here... I'm very happy with the match, it was exciting and that is kind of why I came to new York as well, to experience these emotions.
"He's a great player and he has a great future ahead of him. The fifth (set) is a coin toss and it went my way. "
Referencing back issues that have caused him problems in the last few weeks, Federer said that he was happy to get through his opening match unscathed.
"To get through a five-setter you have to be OK somehow."
Federer: Winning US Open would be 'a joke'
The Swiss' appearance in Flushing Meadows marked his first Major appearance since lifting the cup at Wimbledon in July.
Dropping the first set to the unfancied Tiafoe, ranked 70th in the world, meant that within his first hour on court he had dropped more sets at the US Open than he did during his entire tournament in Wimbledon. He didn't drop a set all tournament at the All England Club this year
-- the first man since Bjorn Borg in 1976 to do so.
That victory handed the Swiss a record eighth Wimbledon singles title, and his 19th major overall. He's seeking to win the US Open for the first time since 2008.
"That would be a joke, if I won three slams this year out of nowhere," said Federer in July, looking ahead to Flushing Meadows.
"I know if I stay in shape there are chances for me to do well at the US Open, but to win it? Yeah, at some stage I almost feel like I have to be realistic."
Every time the Swiss has won both the Australian Open and Wimbledon in a single season, he has also gone on to lift the US Open trophy (2004, 2006 and 2007).
"I'll definitely try and get myself organized, prepared and ready so that I'll have the best chance to do well at the US Open," said Federer.