The Frenchman beat his Spanish counterpart 7-6(6) 4-6 6-3 6-1 in just over two-and-a-half hours to book a date with defending champion Marin Cilic in the next stage.
Chardy inflicted two breaks of serve, either side of one from Ferrer, in the first five games to lead 3-2, but another from the pre-match favourite levelled things up at 5-5.
The nip-and-tuck nature of the contest followed into the tie-break where, after breaking one another on three occasions, Chardy pulled out a crucial break on the 13th point en route to an 8-6 win.
Ferrer - a two-time semi-finalist at Flushing Meadows - responded well by breaking Chardy in the seventh and ninth games of the second set as he levelled up the match.
The world number 26 refused to let Ferrer's control grow, however, as Chardy inflicted a break of serve in the sixth game to move 4-2 up, which was enough daylight to help re-establish the lead.
Ferrer's resistance waned further in the fourth and final set, as Chardy broke the Spaniard four times in total to cruise into the next phase.