"One was to win the US Open and the other one is to be like Roger. One is done, but I need to improve a lot to be like you," he said, looking at the 28-year-old Federer, winner of a record 15 major titles.
"You fought until the final point. You are a great champion," he added.
Del Potro had never beaten Federer in six previous meetings, losing in the semi-finals of the French Open after taking a two sets to one lead.
The Argentinian overcame some early jitters and a first set that saw him struggle with his first serves and heavy forehand in breezy conditions at the National Tennis Centre in New York city.
But as the match wore on, he began to find his range and took advantage of Federer's faulty serve.
Del Potro won the second-set tiebreaker 7-5, and after double-faulting the last two points to lose the third set, battled the world number one to another tiebreaker in the fourth.
|Roger Federer, right, said del Potro was 'a better man' on Monday [AFP]
The Argentinian won that decider by 7-4 to take the match into a fifth set, where he broke the French Open and Wimbledon champion in the second game and sealed his win by breaking the Swiss again in the final game.
Del Potro had 37 winners off his huge forehand and took advantage of a poor serving performance by Federer, who successfully landed only half of his first serves and double-faulted 11 times.
Federer, whose last defeat at Flushing Meadows came against another Argentinian, David Nalbandian, in the fourth round of the 2003 tournament, fell short of matching American Bill Tilden's mark of six US titles in a row in the 1920s.
He told reporters he "got off to a good start and had many more chances to make a difference", but "he hung in there and gave himself chances, and in the end he was a better man".
"You can't have them all," he said. "I've had an amazing summer and a great run."