PITTSBURGH (AP) -- There's still a tomorrow for the Pittsburgh Steelers , all they could have asked for only days ago. There's also a next week for the Baltimore Ravens , or exactly what they didn't want.
Jeff Reed 's 38-yard field goal put Pittsburgh ahead with 5:25 remaining and the Steelers finally preserved a fourth-quarter lead, beating rival Baltimore 23-20 on Sunday to further jumble the complicated AFC postseason race.
The Steelers (8-7), their season seemingly ended by a late-season five-game losing streak, followed their last-second 37-36 victory over Green Bay with another tight victory helped by Reed's three field goals and Rashard Mendenhall 's touchdown run. Now, their final regular season game at Miami will have some meaning, although the Steelers could win and still be eliminated.
According to the NFL, the Ravens (8-7) will clinch an AFC wild-card playoff spot if they win Sunday at Oakland. The Steelers must win and hope for some losses as the Jets, Ravens, Broncos, Texans and Pittsburgh all go into the final weekend with the same record.
''It's been do or die for us for a while, fighting to the last minute. We're like the cardiac kids,'' said Ben Roethlisberger , who threw a touchdown pass while becoming the first Steelers quarterback to pass for 4,000 yards in a season.
Joe Flacco threw touchdown passes of 30 and 7 yards to Todd Heap , but the Ravens couldn't overcome two touchdowns wiped out by penalties, a dropped TD pass by Derrick Mason and 113 yards in penalties. If they had won, the Ravens would have clinched because the Jaguars and Broncos both lost. Instead, their season could be riding on the Oakland game.
''We can't wait to go get on that plane,'' Ravens coach John Harbaugh said.
The Super Bowl champion Steelers have lost six leads in the final quarter during a season marked by victories over contenders San Diego, Baltimore, Minnesota, Green Bay and Denver, and losses to the Chiefs, Raiders and Browns. This time they closed it out with a scoreless final quarter after giving up a 20-10 lead during the third.
''We know our defense has been struggling to stop teams at the end of the game, and this was big for us,'' linebacker James Farrior said. ''Hopefully it will carry over and we'll have teams do what need to do and we can get into the dance, because that's the ultimate goal.''
Ray Rice ran for 141 yards to end Pittsburgh's 33-game streak of not allowing a 100-yard rusher, but Baltimore still lost its fifth game by six points or fewer.
The Ravens were repeatedly hurt by their mistakes and penalties during their ninth loss in their last 10 in Pittsburgh, counting the playoffs.
A wide-open Mason, their most reliable receiver, dropped a certain touchdown pass in the end zone on the first play of the fourth quarter when the ball clanked off his face mask, preventing the Ravens from going ahead 27-20.
During a testy postgame news conference, Harbaugh wouldn't blame the disparity in penalties - 113 yards to Pittsburgh's 20 - or the squandered chances.
''You can go to penalties if you want, you can put your finger on whatever you want, but we're going to Oakland and we're going to play our hearts out,'' Harbaugh said.
Baltimore had a chance late, but rookie defensive end Ziggy Hood - who earlier got his first NFL sack - recovered Flacco's fumble on fourth-and-10 from the Steelers 39 with 2:27 to play. After that, an apparent interception thrown by Roethlisberger was wiped out by an illegal contact penalty on cornerback Frank Walker , and Pittsburgh ran out the clock.
Roethlisberger followed his franchise-record 503-yard game against Green Bay by going 17 of 33 for 259 yards, including a 24-yard TD pass to Santonio Holmes that ended a 94-yard drive during the final 2 minutes of the first half.
''He (made the wrong adjustment) and I shouldn't have thrown it, but I did and we scored,'' Roethlisberger said. ''It was completely wrong in every way except we scored a touchdown.''
Roethlisberger has 4,108 yards with one game remaining, while Mendenhall gained 36 yards to give him 1,014.
Flacco started the second half by hitting Heap for 7 yards to end a 64-yard drive, and Domonique Foxworth 's interception led to Billy Cundiff 's 35-yard field goal and a 20-20 tie. But the Ravens could have had much, much more.
Foxworth scored on the interception, only to have Terrell Suggs ' illegal block penalty put the ball back on the Steelers 37.
''Missed opportunities is the moral of this story,'' Foxworth said.
On Baltimore's next possession, Willis McGahee 's apparent 32-yard TD run was wiped out by a holding call on wide receiver Kelley Washington , and the Ravens punted.
''I think that call was very late,'' Harbaugh said. ''It didn't seem like if affected the play.''
Rice wouldn't blame the officials, saying, ''We score points, we win the game. Everything else is self-explanatory.''
NOTES: The Steelers have two 1,000-yard receivers (Holmes, Hines Ward ), a 1,000-yard rusher and a 4,000-yard passer for the first time. ... Pittsburgh went 6-2 at home. ... The Steelers allowed 121 points in the final quarter during their first 14 games, second most in the league. ... Farrior's interception in the first quarter was Pittsburgh's first in seven games. ... The Ravens are 0-3 in Pittsburgh the last two seasons.