PHILADELPHIA -- The injury-depleted defense held on long enough for Carson Wentz and Philadelphia's new-found rushing attack to rally.
Wentz made key throws and undrafted rookie Josh Adams delivered big runs to put the defending Super Bowl champions back in the playoff chase.
"This was a big game mentally, to show resilience and battle back," said Wentz, who was 20 of 28 for 236 yards and one touchdown.
Adams scored on a 1-yard TD run and ran up the middle for the 2-point conversion to give Philadelphia a 22-19 lead.
After the Giants tied it on Aldrick Rosas' third field goal, a 29-yarder, the Eagles controlled the ball for 5:27.
Coach Doug Pederson went for a fourth-and-1 at the Giants 42 and Wentz completed a 12-yard pass to Nelson Agholor right before the two-minute warning. Adams ran three times and Elliott made the go-ahead kick.
"I had a lot of confidence in our guys, they played man zone and it was well executed," Pederson said about the pass to Agholor. "Guys knew exactly what to do. Great job by Carson hanging in there in the pocket."
The Giants started at their own 34 with 16 seconds left but couldn't do much.
The Eagles (5-6) stayed in the mix in a mediocre NFC East. The Cowboys and Redskins are tied for first place at 6-5. The Giants fell to 3-8.
In the first half, Eli Manning picked apart a Philadelphia defense that was missing its top four cornerbacks, a starting safety and starting linebacker. But Manning threw an interception to Malcolm Jenkins at the Eagles 2 before the second quarter ended.
"Knowing they were struggling (with injuries) in the secondary, personally I would've loved to attack them. But that wasn't in our game plan," Beckham said.
The Eagles relied on their little-used rushing attack to take the lead in the fourth quarter. Wentz tossed a 23-yard screen pass to Corey Clement and the next six plays were runs, capped by Adams' score.
Adams had a career-best 84 yards on 22 carries.
After Barkley broke loose up the middle for a 51-yard TD to give the Giants a 19-3 lead, the Eagles finally answered.
Wentz fired a 15-yard TD pass to Zach Ertz and flipped the ball to Clement on an option play for the 2-point conversion, cutting the deficit to 19-11 late in the second quarter.
Elliott's 28-yard field goal made it 19-14 in the third.
The Eagles stepped up on defense, forcing three straight punts in the second half to allow the offense to rally.
Coming off the most lopsided loss by a defending champion -- 48-7 at New Orleans -- the Eagles fell behind early again.
The Giants jumped ahead on the opening drive. Manning flipped a 13-yard TD pass to Barkley, but the 2-point conversion failed after a penalty on the Eagles allowed the Giants to go for it from the 1.
The Eagles appeared to tie it on a 52-yard TD run by Adams but a holding penalty on center Jason Kelce negated the score.
Barkley only had five touches in the second half after 15 in the first.
"We're going to spell him a little bit as we go," Giants coach Pat Shurmur said. "It had nothing to do with the outcome of the game."
The Eagles are 17-4 against the Giants since 2008, including 9-1 in the last 10.
"For me, it's a dream come true," LeBlanc said about covering Beckham. "He's phenomenal. I fear no man. At the end of the day, line up, he put his pants on, I put my pants on and we're gonna play ball."
The Eagles were scoreless in the first quarter for the fifth straight game and ninth time this season. They only have 21 points in the opening quarter.
Giants: Host the Chicago Bears (8-3) next Sunday.
Eagles: Host the Washington Redskins (6-5) on Dec. 3.
More AP NFL: https://apnews.com/NFL and https://twitter.com/AP-NFL
How Baker Mayfield paid off his bet with Saquon Barkley
"The loser's got to get someone else a chain," the Giants running back said in February of their bet over Offensive Rookie of the Year.
Matt Ryan: Falcons have 'a great chance' to return to Super Bowl
The Falcons are 17-15 since their 2016 Super Bowl run, but QB Matt Ryan seems to have more swagger regarding his team's contender status this year.
Selfless neighbor provides liver, hope for mom of New York Giants' Grant Haley
The second-year cornerback is thankful for the woman who helped his family in a dire time of need as "it was tough to see your mom like that."
Brees awarded $6M in diamond fraud lawsuit
A jury has awarded more than $6 million to Saints quarterback Drew Brees in a lawsuit that claimed a San Diego County jeweler sold him overpriced diamonds.
Who will rule the NFC East?
The Live crew debate whether the Cowboys or the Eagles win will the NFC East.
OBJ: Couldn't reach 'full potential' with Giants
Browns wide receiver Odell Beckham Jr. addressed his Giants exit in an interview with Complex, saying he had to leave New York because he "wasn't going to be able to reach my full potential there."