BALTIMORE — The Ravens did what they needed to do to snap their five-game losing streak against Cincinnati.

No matter how depleted the current Bengals might be, you don’t take a victory for granted when you haven’t beaten the division rival in over three years and you need to win. The 19-14 final drew Baltimore even with Pittsburgh for first place with the calendar turning to December this week.

The Ravens couldn’t ask to be in better position, especially when you recall where they were a month ago.

But several offensive starters lamented the inability to build off a fast start that included a Joe Flacco 14-yard touchdown pass to Breshad Perriman and a field goal on their first two drives of the game. Leading 16-3 at halftime, the Ravens went 0-for-6 on third down and managed only one field goal the rest of the way, which gave the Bengals a chance to tie the game before Elvis Dumervil’s strip-sack and Lawrence Guy’s recovery with just over a minute remaining.

Yet again, a good defensive performance and a perfect Justin Tucker played the leading roles in the win while the offense spun its wheels after some early success.

“I’m confident in my ability to play games like this and win down the stretch and do the right thing with the football,” said Flacco, who was a relatively efficient 25 of 36 for 234 yards and an interception to go with the opening-drive score. “But in order for us to take that next step and be the kind of team that we want to be and be a championship football team, we’re not going to survive week in and week out doing things like this. We’ve got to keep the foot on the gas and learn how to put teams away.”

The ninth-year quarterback offered the same sentiment after the Week 3 win in Jacksonville two months ago. Fortunately, the offense has recovered from its miserable — and injury-plagued — October, but Flacco’s words reflect the lack of overall improvement from the opening month of the season until now.

The Ravens have scored just 19 touchdowns this season, ranking 31st of 32 teams in the NFL. The offense certainly deserves credit for the work required to put Justin Tucker in position to go a league-best 27-for-27 on field goal tries, but 18 were from 40 yards or longer, meaning the Ravens haven’t exactly been all that close to the end zone on most of those drives.

Baltimore has managed more than one offensive touchdown in just five of 11 games and has scored fewer than 20 points six times. The Ravens have scored 25 or more in just three games with two coming against winless Cleveland.

It’s scary to think where they might be without Tucker, who is rapidly cementing himself as the league’s best kicker and is an impressive 7-for-7 from 50 yards and beyond after converting three from that range in the first half on Sunday. He’s been to the Ravens what All-Star closer Zach Britton was to the Orioles this past season, the difference in making them a playoff contender despite other flaws.

For now, the offense can only continue working to improve, pointing to the recent stabilization of the offensive line and the steady emergence of rookie running back Kenneth Dixon as reasons for optimism.

“I know that we’re getting better on offense,” head coach John Harbaugh said. “I think we’re doing a good job, but we’re striving for more than that. Our guys are going to tell you, we want to put a lot more points up than that. That’s what we’re working towards.”

The most encouraging development from Sunday’s game may have come on the opposite side of the ball with the return of Dumervil, who was rusty in his first action in seven weeks until the final defensive play when he blew past Bengals right tackle Eric Winston to strip quarterback Andy Dalton of the football inside the red zone. The turnover sealed the victory for the Ravens defense, who buckled but didn’t break against a Cincinnati offense lacking its best player in wide receiver A.J. Green.

The Ravens need top cornerback Jimmy Smith to return from a back injury that’s sidelined him for the last two games, but a healthy Dumervil could work wonders for an edge pass rush that’s relied heavily on fellow veteran Terrell Suggs, who collected two strip-sacks of his own on Sunday. It was just the third game of the season for Dumervil, who’s dealt with a frustrating rehab from offseason foot surgery.

“You get a guy and add that to the defense that we already have, it just opens up the possibilities of being even better than what we are right now,” safety Eric Weddle said. “It was huge. He practiced outstanding the last two weeks. We knew it was going to give us a boost, and adding him across from [Suggs] and our other rushers and [to] our game plans, we’re going to be a tough team to stop.”

The Ravens keep hoping for their offense to improve, but maybe the current formula can be enough. After all, it’s earned them a 6-5 mark to this point, which is good enough for a first-place tie with a Steelers team sporting a very good offense but a below-average defense.

Baltimore plays two of the next three at home against Miami and Philadelphia, who are formidable teams but hardly juggernauts. The surprising Dolphins have won six straight, but the last five have been by a single possession and they rely heavily on their running game, a favorable matchup for the Ravens at M&T Bank Stadium.

Whether the Ravens will find enough wins over the final five games to make the playoffs remains to be seen, but Sunday was another reminder that it will probably look the way it has all season — a good defense, a frustrating and below-average offense, and the best kicker in football.

“If it ain’t tough, it ain’t the Raven way,” Suggs said. “I really wish we could have got off the field instead of scaring everybody and having Elvis make a fantastic play. But that’s the Raven way. It ain’t pretty, but we’ll take it.”