(CNN) -- The odds were against Richard Gasquet when he went to a fifth set against David Ferrer at the U.S. Open.
Gasquet only registered one win in nine previous tussles against Ferrer, was coming off a nearly five-hour marathon against Milos Raonic in which he saved a match point and had dropped the third and fourth sets Wednesday.
He has blown a two-set advantage at majors before, most notably to Andy Murray at both Wimbledon and the French Open.
While the Frenchman has never been known for being tough on court, Ferrer is a warrior and one of the fittest players in tennis.
But it was Gasquet who won that fifth set and the encounter 6-3 6-1 4-6 2-6 6-3 to reach his first grand slam semifinal in six years.
He became just the second Frenchman to make the semifinals in New York in the Open era after Cedric Pioline.
"I have experience in five sets," Gasquet said in an interview on court. "I played a lot in my life so this one was very important to get into the semis in the U.S. Open.
"I knew I had to serve well. I kept my serve in the fifth. It's a big win for me."
Ferrer gifted Gasquet a break when he double faulted serving at 2-3 in the fifth and the world No. 9 held on.
His foray into the last four is sure to please tennis purists who marvel at Gasquet's one-handed backhand and all-around game -- even if the 27-year-old can still play too defensively by standing yards behind the baseline.
Gasquet will play his pal and tournament favorite Rafael Nadal in the last four after the second seed ruthlessly dispatched of fellow Spaniard Tommy Robredo 6-0 6-2 6-2.
Nadal defended Gasquet when the latter tested positive for cocaine several years ago, believing the right-hander's story when he said the drug got into his system when he kissed a girl.
Gasquet is 0-10 against Nadal -- in their pro career. Nadal is also on a 20-match hard-court winning streak this year.
"The last time I beat (Nadal) I was 13," Gasquet said, drawing laughs from the crowd. "So it's a long time ago. I beat him one time in my life.
"I will try to play a big match."
There was also an upset in the women's quarterfinals, as Flavia Pennetta beat Roberta Vinci 6-4 6-1 in a battle of Italians.
Pennetta, into her first grand slam semifinal, suffered a career-threatening wrist injury that required surgery and missed six months starting in August 2012.
A former world No. 10 in singles and ex No. 1 in doubles, Pennetta didn't expect to hit form in New York.
"The results after my injury haven't come that quickly," she told the WTA website. "These are the first two weeks where I feel better and feel like myself again. But New York is special for me and the crowd is special for me, too.
"It's just amazing. I'm really happy."
Pennetta, a quarterfinalist in New York in 2008, 2009 and 2011, takes on second-seed Victoria Azarenka in the semifinals.
Azarenka, a beaten finalist in 2012, recorded a straight-sets 6-2 6-3 win over Russian Daniela Hantuchova.
Serena Williams plays Li Na in the other semifinal.