Baltimore Ravens wide receiver Torrey Smith secures the winning touchdown pass, beating William Gay (22) and Ryan Clark (25) on the play. (Don Wright/Associated Press)

A second victory this season over the Pittsburgh Steelers and a share of first place in the AFC North nearly slipped from the grasp of the Baltimore Ravens on Sunday night at Heinz Field. They allowed a 10-point lead in the fourth quarter to dissipate, and two passes by quarterback Joe Flacco bounced off the hands of wide receivers as the Ravens closed in on a winning touchdown in the final minute.

But it took only one dramatic play to fix all of that, as rookie wide receiver Torrey Smith hauled in a 26-yard touchdown throw by Flacco with eight seconds remaining to give the Ravens a wild, 23-20 triumph over the Steelers.

“That says something about our team,” Ravens linebacker Terrell Suggs said, “and that definitely said something about our quarterback. It’s a big accomplishment.”

Smith’s catch, which he made despite a pass-interference penalty by Steelers cornerback William Gay, capped a 92-yard drive by the Ravens in a little more than two minutes. The Ravens, who beat the Steelers decisively in Baltimore in the opening game of the season, moved into a first-place tie with the Cincinnati Bengals in the AFC North, with identical 6-2 records. The Steelers, at 6-3, dropped into third place.

“They made plays,” Steelers safety Troy Polamalu said. “We didn’t. They even dropped a couple that were possible game-winning catches. . . . He [Flacco] made good throws.”

The Steelers used a one-yard touchdown run by tailback Rashard Mendenhall and a 25-yard touchdown pass from quarterback Ben Roethlisberger to wide receiver Mike Wallace to turn a 16-6 deficit entering the fourth quarter into a 20-16 lead. The Ravens were on the verge of being beaten when Smith had a pass from Flacco deflect off his fingertips in the end zone with 35 seconds to play. Fellow wide receiver Anquan Boldin had another pass bounce off his hands soon thereafter.

But the Ravens, improbably, got the win when Flacco lobbed a pass to Smith, who made the catch in the end zone.

“You take a couple shots at the end zone,” Flacco said, “and you see what comes of it.”

Said Smith: “For him to keep coming back to me, it meant a lot.”

The Ravens had a would-be touchdown run by tailback Ray Rice on the game’s opening play negated by a penalty. That was the first in a series of frustrations for the Ravens, who seemed in control of the game for much of the night but never could put the Steelers away until the final seconds. Rice had a third-quarter touchdown run and kicker Billy Cundiff provided three field goals.

“It’s huge,” Suggs said. “We swept them. But don’t be fooled. We’re going to have to see this team in January. We just positioned ourselves for them to have to come to” Baltimore.

Kicker Shaun Suisham had two field goals for Pittsburgh, which played without wide receiver Hines Ward after he was hurt on a first-half hit by Ravens linebacker Ray Lewis. Ward watched the remainder of the game from the Steelers’ sideline, and Coach Mike Tomlin said afterward that Ward had concussion-like symptoms.

“That’s a tough defeat for us,” Tomlin said.

The Ravens beat the Steelers, 35-7, in the season opener in Baltimore. But it was the Steelers who began the day in first place as the two teams renewed one of the league’s fiercest rivalries.

The Pittsburgh defense was without injured linebackers James Farrior and LaMarr Woodley, although fellow linebacker James Harrison made his return to the lineup after missing four games because of a fractured orbital bone and had three sacks.

The Ravens appeared to grab a quick lead when Rice dashed 76 yards to the end zone on the opening play. But the touchdown was nullified by a holding call on Smith, who was blocking Gay. The Ravens regrouped and moved down the field, with Flacco providing third-down completions to tight end Dennis Pitta and Boldin to keep the drive going.

A pass-interference penalty on Gay, who was covering Smith on a fade pattern in the end zone, gave the Ravens a first down at the Pittsburgh 1-yard line. But they couldn’t get the yard they needed. Flacco threw a first-down incompletion on a pass that nearly was intercepted by safety Ryan Clark. Rice was stopped for no gain on second- and third-down carries, and the Ravens had to settle for Cundiff’s short field goal.

The Baltimore defense forced a punt after the Steelers managed to hold the ball for only three plays on their opening drive, and the Ravens were back at it on offense. Flacco had two more third-down completions, including a lob to Smith for a 29-yard gain. But the Ravens’ drive stalled and Cundiff pushed a 40-yard field goal try wide right.

So the Ravens had little to show for a first quarter in which they had possession of the ball for nearly 11 1 / 2 of the 15 minutes, and the Steelers drew even when Suisham connected on a 36-yard field goal in the opening minute of the second quarter.

Cundiff’s 43-yard field goal gave the Ravens another lead, and Suisham’s 30-yarder got the Steelers even. A personal foul called on Clark helped the Ravens move into position for Cundiff’s third field goal, a 51-yarder as time expired in the half.

The Steelers had a scoring opportunity right away in the third quarter, moving to a first down at the Baltimore 14-yard line. But Suggs made a leaping interception as Roethlisberger attempted to zip a quick screen pass to Wallace.

The Ravens capitalized. A pass-interference penalty on Steelers cornerback Ike Taylor, who was called for a slight tug of Boldin’s jersey, gave the Ravens a first down at the Pittsburgh 4. Flacco threw a first-down incompletion but Rice got into the end zone on a second-down carry for the game’s first touchdown. The Steelers had an immediate reply, crafting a solid drive that ended with Mendenhall’s touchdown in the opening minute of the fourth quarter.

Flacco lost the ball on Harrison’s third sack of the night, and Gay recovered the fumble for the Steelers. Roethlisberger’s go-ahead touchdown pass to Wallace came with just less than five minutes left, after he scrambled to his right to avoid the Ravens’ pass rush.

The Steelers were lining up for a 47-yard field goal attempt by Suisham with a little more than 21 / 2 minutes to play. But they were assessed a delay-of-game penalty before they could take the kick, and ended up punting to set up the Ravens’ winning drive.

“I accept responsibility for that,” Tomlin said. “There was some hesitation on that. I was concerned about that distance.”