The 136th-ranked Ms. Giorgi struck 46 winners to Ms. Wozniacki's 13 to ensure the Dane's long, and to date fruitless, quest for a grand slam title would go into another season.
The 23-year-old sixth seed fought until the very end, saving four match points before the ultra-aggressive Giorgi hit one final winner to finish proceedings in two hours and 32 minutes.
"All of a sudden she came into the rhythm and just started hitting everything, and it was starting to go in," Wozniacki said.
"She put me under pressure and I started to play a little short. And then all of a sudden she was all over the ball. I felt like I needed to push her back but she took very high-risk shots and things were going in for her. She was going for the lines and hitting them when she wanted to."
Wozniacki reached the U.S. Open final in 2009, where she was defeated by Kim Clijsters. Seven years after playing her first grand slam, at Wimbledon, the girlfriend of golf major champion Rory McIlroy has yet to win one of her own.
Her defensive style rarely keeps her in the contest against the likes of the Williams sisters or Maria Sharapova, and Giorgi took a leaf from their manuals.
Wozniacki's best result at the slams this year was reaching the fourth round at the Australian Open.
"I think it's normal to be disappointed," she said. "We were playing two-and-a-half hours out there, I lost the match and I would obviously have loved to be in the next round.
"It's tough to be really aggressive when someone is just going for every shot. It wasn't the best year for me at the majors, but there is a next year."
Giorgi, who received a code violation for illegal coaching from her animated father, Sergio, said it was a dream come true to simply play inside Arthur Ashe Stadium.
"I wanted that," said the 21-year-old, who faces 10th seed and fellow Italian Roberta Vinci at 11 a.m. Monday for a place in the quarter-finals. "It was my goal to be there. It was amazing to play there. I was focused for every point. I think I played better tactically, maybe. When the ball came, I just tried to hit it in the corners."
(Editing by Nick Mulvenney)