With their backs against the wall, the New Orleans Saints dug deep and nearly found a way to end the Carolina Panthers’ storybook run.

But in the end, the team that dominated the NFC South for so long with Sean Payton and Drew Brees at the helm came up short against a Carolina team that has established itself as the new class of the division.

New Orleans put Carolina’s undefeated season on the brink Sunday, only to see Cam Newton pull the Panthers out of danger with an MVP-caliber performance, striking the last blow in a 41-38 barnburner that offered glimpses of both the Saints’ potential and highlighted the problems that have sent New Orleans careening to a four-game losing streak and the bottom of the division.

“Obviously it’s a disappointing loss, and it’s frustrating,” Payton said. “They made enough plays in the end, and that ended up being the difference.

New Orleans (4-8) proved it still has plenty of fight left in a locker room that has remained resolute despite the losses. When Mark Ingram powered into the end zone with 5:21 left, the Saints had a 38-34 advantage, a raucous crowd and a defense that forced the Panthers into a fourth-and-5 situation with two minutes left and the game on the line.

That’s when Newton came up big, breaking out of the pocket and finding Greg Olsen for 16 yards to set up his game-winning, 15-yard touchdown pass to Jerricho Cotchery with 65 seconds left.

“They had good play-calling,” Saints middle linebacker Stephone Anthony said. “Cam made some big plays, as expected.”

Facing off against a Carolina team that clinched its third straight NFC South title before kickoff as a product of Tampa Bay’s victory over Atlanta, New Orleans opened the game on a run that has been rarely seen since the Saints reeled off a three-game winning streak to get back to .500.

And it was coordinator Dennis Allen’s defense that provided most of the momentum early.

New Orleans forced a three-and-out on its first defensive series, setting up a Brees touchdown pass to Benjamin Watson by handing the offense incredible field position.

Then the Saints defense started creating turnovers. First-year cornerback Delvin Breaux picked off Newton on the next series, Anthony returned a fumble 31 yards for a touchdown and Brian Dixon shut the door on a potential game-tying drive early in the second quarter by ripping the ball out of Olsen’s hands.

But unlike during their three-game winning streak, the Saints offense failed to use those turnovers to bury Carolina (12-0) and its undefeated season early.

After a missed field goal by Kai Forbath and a few stunted drives, the Panthers cut the gap to 16-13 at halftime.

Defensively, the Saints took a big loss. Already thin at cornerback amid a season-long rash of injuries, New Orleans lost Breaux to a pulled hamstring early, and the Panthers took advantage of both Breaux’s absence and the Saints’ inability to execute on offense to put New Orleans on its back.

Newton came roaring back with touchdown passes to Ted Ginn and Devin Funchess to give the Panthers a 27-16 lead.

“A lot of great things, a lot of great flashes, but that’s been the plague of this season,” defensive end Cameron Jordan said. “We’ve had a lot of great flashes, but there’s still a lot of things we don’t capitalize on, and that’s something we have to take into account.”

Carolina had New Orleans on the ropes, particularly considering the Saints offense had scored just 34 points in its previous 12 quarters.

Then the Saints offense came alive, sparked by a 54-yard touchdown pass from Brees to receiver Brandin Cooks. Brees followed that with a go-ahead touchdown pass to Brandon Coleman and, all of a sudden, the Saints had a 31-27 lead and were in the kind of shootout that has been prevalent the past two seasons.

But without Breaux, the defense couldn’t shut Newton down again: He finished 28-of-41 for 331 yards and five touchdowns. The Saints, though, are tired of using the injuries as an excuse.

“We’ve got to be able to hold up,” free safety Jairus Byrd said. “If someone goes down, we’ve got to be able to step right in and pick it up. Any time you have injuries, that’s unfortunate, but you have to be able to step in and make plays.”

Injuries weren’t the only season-long issue that cost the Saints on Sunday. New Orleans also committed six defensive penalties on third down, extending drives and handing Newton more chances to match Brees blow for blow.

“It’s one thing to say we’re a young team and we’re still learning, but at this point, we’re 12 games in now,” Jordan said. “This is something we have to focus on and completely change. That can’t be happening.”

Now a frustrated Saints team that is still mathematically alive for a playoff berth has to find a way to bounce back from another disheartening loss.

The question is whether the Saints can start turning flashes of brilliance into wins.

“Let’s just put the record aside for a moment,” Brees said. “Mathematically, I don’t know what the chances are of us making it to the postseason. What I care about is, by the end of the season, are we as good of a team as I know we can be? All of these things that we have been talking about — the execution, the mistakes, certain things that keep repeating themselves — I’m more concerned about correcting those things so we can get to the level I know we should be playing at.”

And so the Saints can stop missing opportunities like the one they had Sunday.