Second-half substitute De Nigris on Saturday grabbed an equalizer for Mexico in the 48th after Carlos Ruiz' fifth-minute strike put Guatemala ahead.
Hernandez scored the match-winner in the 65th as Mexico advanced to a semi-final clash against Honduras, who advanced 4-2 on penalties against Costa Rica after they played to a 1-1 draw in extra time.
Honduras advanced in the first game of a doubleheader at New Meadowlands Stadium that drew a largely pro-Mexican sellout crowd of 78,807.
Mexico and Honduras will play on Wednesday in Houston.
The remaining two quarter-finals are slated for Sunday in Washington, where the United States will face Jamaica and Panama take on El Salvador in the regional championship for North and Central America and the Caribbean.
The winners of the tournament book a berth in the 2013 FIFA Confederations Cup.
Mexico stayed on course for a title repeat despite a squad reduced to 17 men after the national federation withdrew five players who tested positive for banned clenbuterol at a pre-tournament training camp in May.
Guatemala came out clearly focused on pulling off the upset, and Ruiz's quick strike shocked the pro-Mexico crowd.
Elias Enoc Vasquez's long pass started the play. After Mexican defender Hector Moreno failed to kick the ball clear, Guatemalan captain Ruiz floated it over Mexico keeper Alfredo Talavera.
Ruiz came close again in the 73rd, with Talavera making a narrow save of his 25-yard shot to keep Mexico ahead.
Mexico, whose 14 first-round goals were seven more than any other team in group play, made one substitution at halftime as De Nigris replaced Israel Castro and made an immediate impact.
In the night's opening match, Honduran goalkeeper Noel Valladares saved a penalty in regulation for the second time in as many matches as Honduras and Costa Rica ended extra time level at 1-1.
Costa Rica's Celso Borges and Alvaro Saborio both hit the crossbar on their shootout attempts as Honduras won the decider.
Jerry Bengtson had given Honduras the lead in the 49th minute, with Dennis Marshall equalizing in the 56th.
Valladares made sure the match stayed level in the 76th with a diving stop of Saborio's penalty attempt.
"I've felt the emotions of scoring a goal for my country, but you can't compare it to stopping a PK," Valladares said. "I've lived (stopping PKs) more, and I've felt it more."
Carlo Costly, Victor Bernardez, Wilson Palacios and Bengtson all converted in the penalty shoot-out for Honduras.
Bryan Ruiz and Joel Campbell converted in the shoot-out for Costa Rica.
What the stars mean:
★ Poor ★ ★ Promising ★★★ Good ★★★★ Very good ★★★★★ Exceptional