David Ferrer, the top-ranked Spaniard in New York in the absence of the injured Rafael Nadal, saw off 13th-seeded Frenchman Gasquet in two hours and 54 minutes of playing time.
But two lengthy rain delays meant the tie, which started shortly after 1:15 p.m. local time, did not finish until just before 8:30 p.m.
Fourth seed Ferrer will face either Serb eighth seed Janko Tipsarevic or Philipp Kohlschreiber, the German 19th seed, for a place in the semi-finals.
"The rain made it very difficult," said Ferrer. "But the fans have been great and I wanted to win it for them."
The 30-year-old Ferrer took a 7-1 career lead over Gasquet into the last-16 tie, having also triumphed at the same stage at the Australian Open this year.
He made that 8-1 on a fifth match point on a damp and humid Louis Armstrong Stadium.
Ferrer was a semi-finalist in New York in 2007 and is currently enjoying one of his best years on tour with his five titles second only to the six won this year by Roger Federer.
Kohlschreiber was facing another night-time battle having equalled the US Open record for a late finish when he completed his third round win over John Isner at 2:26 a.m. on Monday morning.
The German reached his first career Grand Slam quarter-final at Wimbledon this year at the 33rd attempt.
Tipsarevic, meanwhile, achieved his best result at a major in New York 12 months ago when he made the quarter-finals.
Defending champion Novak Djokovic, the second seed, bids to reach the quarter-finals for the sixth straight year, and his 13th successive last-eight at a major, when he takes on Swiss 18th seed Stanislas Wawrinka.
Djokovic has a 10-2 record against Wawrinka with the Swiss player not having defeated the world number two in six years.
The Serb, who is also the Australian Open champion, has only dropped 14 games in three rounds in New York this year.
Wawrinka is bidding to reach the quarter-finals for the second time, having made the last eight in 2010 where he was beaten by Russia's Mikhail Youzhny.
The 27-year-old Swiss has lost 18 matches in a row against top 10 players.
Djokovic or Wawrinka will go on to face either 2009 champion Juan Martin Del Potro, the Argentine seventh seed, or 2003 winner Andy Roddick for a place in the final.
Roddick is playing in his last tournament before retirement.
Del Potro -- whose New York triumph in 2009 was the only time in the last 30 majors that either Djokovic, Federer or Nadal wasn't champion -- is trying to make the last eight for the first time since that win.
The big Argentine has won three of his four meetings with Roddick, but the American came out on top in their most recent clash, in the semi-finals on hardcourt in Memphis in 2011.
Roddick announced earlier in the tournament that he would retire once this US Open ends.
His 2003 victory in New York remains was the last time an American man won a Grand Slam title.