TAMPA, Fla. — Bloodied and battered by long losing streaks, the New Orleans Saints keep proving they can pick themselves back up.

And this time, the Saints did it by putting together one of their most complete games of the season.

Efficient on offense and surprisingly effective on defense, New Orleans held the lead wire-to-wire to knock off a surging Tampa Bay Buccaneers team with playoff hopes 24-17 on Sunday, snapping a four-game losing streak and keeping the Saints’ slim hopes of a playoff berth mathematically alive.

“I’d say it was one of the team games we’ve been waiting for,” coach Sean Payton said.

New Orleans (5-8) has quietly been making strides on defense since Dennis Allen took over as coordinator. First the Saints showed a resilient streak against Houston, then forced unbeaten Carolina into a series of first-half mistakes before an injury to Delvin Breaux crippled New Orleans’ chances at an upset.

Often criticized and routinely ridiculed, the New Orleans defense finally put it all together against Tampa Bay.

“Any time you can keep your foot on the gas pedal for four quarters, that’s what you’re looking for,” defensive end Cameron Jordan said. “We took off at the beginning of the game and never looked back.”

Allen finally had almost all of his weapons on hand. For the first time in five games, New Orleans had Dannell Ellerbe, the weakside linebacker who has held the key for the defense this season. In the five games Ellerbe has played, the Saints are 4-1, and the defense has been a much tougher unit when the veteran is in the lineup.

Ellerbe plays with a frenetic, relentless style, but his presence brings a stabilizing effect to the rest of the defense.

“He’s really explosive. He can cover,” safety Kenny Vaccaro said. “We’re not worried about him when he’s on the tight end as much, or a (running) back, so we don’t have to lean or change our coverages for him at all. It’s obviously a difference when he’s on the field.”

Ellerbe also emphasizes an Allen staple.

New Orleans has communicated better before the snap since Allen took over, allowing the Saints to improve one of the league’s worst run defenses by getting more tacklers to the ball. A young Saints defense that started five rookies or first-year players is still learning to identify plays by formation, and improved communication has allowed the defense to start playing a little faster.

Allen’s detail-oriented, disciplined approach is starting to take hold.

New Orleans gave up 6.1 yards per carry to Tampa Bay and the NFL’s second-leading rusher Sunday but, for the most part, the Buccaneers failed to pick up the kind of yardage on first and second down that could put the Saints on their heels on third down. Tampa Bay converted just 4-of-11 third-down opportunities.

“The effort hasn’t changed; the intensity hasn’t changed,” rookie linebacker Hau’oli Kikaha said. “We had good preparation for this game, good run-pass indicators, so it kind of gets you to the ball a little faster. What it comes down to is our communication is getting a lot better. We kind of key each other in pre-snap, so whatever happens, it’s not a surprise, and guys can get to the ball sooner.”

New Orleans also kept rookie quarterback Jameis Winston in check.

Winston completed 18 of 32 passes for 182 yards, but he only found star receiver Mike Evans three times for 39 yards. Evans had no catches in the teams’ first meeting.

“We studied a lot of tape on him, and we know his tendencies,” cornerback Delvin Breaux said. “That is their big threat player, and we did a pretty good job with keeping him contained and keeping him to the side and not letting him get over the top.”

Put everything together, and New Orleans turned in its best defensive performance of the year.

New Orleans held Tampa Bay to 291 yards, the fewest the Saints have given up all season, and 17 points, the first time the Saints have given up fewer than 20 since beating Carolina 28-10 on Oct. 30, 2014.

“It was a huge step for us,” defensive tackle Kevin Williams said. “We put a complete game together.”

Drew Brees took advantage. Facing a Buccaneers front forced to operate without defensive end Jacquies Smith and with a limited Gerald McCoy, Brees had plenty of time in the pocket this time, and he made Tampa Bay (6-7) pay.

Brees completed his first nine passes, and he tossed the 420th and 421st touchdowns of his career to move past Dan Marino and into fourth place all-time. Brees finished 31-of-41 for 312 yards.

He had plenty of help from a couple of other veterans. Marques Colston, who has been reduced to a No. 3 receiver and entered the game with just one touchdown catch, hauled in two scores, and Tim Hightower churned out tough yards on the ground, picking up 85 on 28 carries and finishing a drive with his first touchdown since Sept. 11, 2011, while playing for Washington.

“I think this says a lot about our team,” Brees said. “Any time you have a young team, you have to go through those growing pains, but guys have always come back to work with a lot of enthusiasm. ... All the way around, it was a really great team win.”

The kind that has been hard to come by for the Saints this season.