The Eagles struggled all game long, but produced when it counted during Thursday’s 22-21 comeback win over the visiting New York Giants.

With under five minutes to go, the Eagles trailed, 21-10, but Carson Wentz then threw touchdown passes of 3 yards to Greg Ward and 18 yards to Boston Scott for the comeback win.

Coach Doug Pederson had praise for Wentz’s performance.

“Facing adversity down a couple of scores in the fourth quarter, he really hung in there,” Pederson said. “It wasn’t maybe on the stat sheet things looked good, but there were some throws, and there were some decisions I think he would want back. But I’ll tell you what, he’s the leader of our team for a reason, and you saw that tonight, leading our team down there to get the two scores late in the game. But overall he hung in there and played tough tonight.”

» READ MORE: Eagles rally past the Giants on Boston Scott’s touchdown catch from Carson Wentz in 22-21 win

Wentz completed 25-of-43 for 359 yards, two touchdowns and one interception. He had a 91.1 passer rating, his highest of the season for the 2-4-1 Eagles.

In the last two games, which includes a 30-28 loss to the Baltimore Ravens, Wentz has led the Eagles to 34 fourth-quarter points.

“He is taking that step in the right direction to be one of the top quarterbacks in this league,” Pederson said. “Quarterbacks in this league sometimes get measured by fourth-quarter comebacks ... and you know he has done that.”

The Eagles continue to be plagued by injuries, and Pederson said that their execution may not always be stylistic.

“You know the situation we are in health-wise as a team. We know these games are going to probably be closer than we would like. But it is good to see your quarterback standing there, going toe-to-toe, taking some shots, and still lead your team down the field for the win.”

Wentz said the Eagles will build off this comeback win.

» READ MORE: Doug Pederson saves himself from having to live down Hakeem Butler moment in Eagles win | Jeff McLane

“It does a lot for our confidence, the way we really fought to come back in the last couple of games, and to actually do it and pull out a win, it’s huge for our confidence, and we know it’s a divisional game. So it’s huge for the NFC East as well,” Wentz said.

That said, Wentz wishes things could be a little easier.

“Ideally, we don’t want to put ourselves in those situations. But when we need it, you know we have been successful for the most part so far," Wentz said,

Pederson said he still believes in kicker Jake Elliott, who has struggled recently and missed a 29-yard field goal.

“I still have a lot of confidence in Jake, and I’ll put him back out there in any of those situations again,” Pederson said.