Oakland Raiders tight end Derek Carrier (85) scores against the Pittsburgh Steelers during the second half of an NFL football game in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/Ben Margot)

Oakland Raiders tight end Lee Smith (86) celebrates with teammates after scoring against the Pittsburgh Steelers during the second half of an NFL football game in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/Ben Margot)

Pittsburgh Steelers wide receiver James Washington (13) is tackled by Oakland Raiders defensive back Rashaan Melvin (22) during the first half of an NFL football game in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/Ben Margot)

Pittsburgh Steelers quarterback Ben Roethlisberger (7) rolls out to pass against the Oakland Raiders during the first half of an NFL football game in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/Ben Margot)

Fans cheer during the first half of an NFL football game between the Oakland Raiders and the Pittsburgh Steelers in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/D. Ross Cameron)

Oakland Raiders quarterback Derek Carr (4) is sacked by Pittsburgh Steelers defensive end Stephon Tuitt, rear, during the first half of an NFL football game in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/Ben Margot)

Pittsburgh Steelers wide receiver JuJu Smith-Schuster (19) catches a touchdown pass during the first half of an NFL football game against the Oakland Raiders in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/D. Ross Cameron)

Pittsburgh Steelers quarterback Ben Roethlisberger, left, talks with head coach Mike Tomlin during the first half of an NFL football game against the Oakland Raiders in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/Ben Margot)

Oakland Raiders quarterback Derek Carr (4) passes against the Pittsburgh Steelers during the second half of an NFL football game in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/Ben Margot)

Oakland Raiders head coach Jon Gruden watches during the first half of an NFL football game between the Raiders and the Pittsburgh Steelers in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/D. Ross Cameron)

Pittsburgh Steelers cornerback Mike Hilton (28) gestures during the first half of an NFL football game against the Oakland Raiders in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/D. Ross Cameron)

Pittsburgh Steelers quarterback Ben Roethlisberger (7) stands on the sideline during the second half of an NFL football game against the Oakland Raiders in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/Ben Margot)

Pittsburgh Steelers quarterback Joshua Dobbs (5) runs against the Oakland Raiders during the second half of an NFL football game in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/D. Ross Cameron)

Oakland Raiders head coach Jon Gruden watches during the second half of an NFL football game against the Pittsburgh Steelers in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/D. Ross Cameron)

Pittsburgh Steelers quarterback Joshua Dobbs (5) hands offn against the Oakland Raiders during the second half of an NFL football game in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/D. Ross Cameron)

Oakland Raiders head coach Jon Gruden watches during the first half of an NFL football game against the Pittsburgh Steelers in Oakland, Calif., Sunday, Dec. 9, 2018. (AP Photo/D. Ross Cameron)

OAKLAND, Calif. — Pittsburgh Steelers quarterback Ben Roethlisberger exits to injury. His team struggles in his absence. Suddenly, to an ovation that gradually grows as a stadium takes notice, he resurfaces from the locker room with a careful jog. The team turns back to its star, who completes every pass on a go-ahead touchdown drive, prompting a raucous applause.

There it was Sunday: a cookie-cutter plot, a neat narrative to net the Raiders their 11th loss.

Too corny? Not predictable?

They agreed, rewriting it with gritty and slippery touch.

Roethlisberger went from hero to helpless, watching Raiders quarterback Derek Carr throw a 39-yard strike to wide receiver Seth Roberts. This set up a Carr touchdown behind a battered offensive line to backup tight end Derek Carrier with 21 seconds remaining. The Steelers nearly answered, but kicker Chris Boswell lost his footing on a 40-yard field goal as time expired in a 24-21 victory.

A better ending, the Raiders felt.

A deserved one.

“I would just like to say,” coach Jon Gruden said, “I am really proud of our team. … The character of this team is impressive no matter what anyone says or saw today. The character in there is special.”

This season has tested the coaches, has tested their players. They’ve endured injuries and losses and trades and, despite little evidence in their on-field effort, been charged as quitters and tankers. They were neither Sunday. That much was clear at the Oakland-Alameda County Coliseum when improving to 3-10.

The result dropped the club’s latest draft position from the No. 1 to No. 3 pick next April.

Out with a rib ailment, Roethlisberger made his dramatic return after missing the first four drives of the second half. His backup, Josh Dobbs, went 4-of-9 for 24 yards. The Steelers (7-5-1) punted twice, turned over a possession on downs and threw an interception. Roethlisberger entered after Carr found tight end Lee Smith for a 3-yard score to take a 17-14 lead with 5 minutes, 20 seconds remaining.

He promptly went 6-for-6 with 70 yards and a 1-yard touchdown to wide receiver Juju Smith-Schuster.

It then was Carr’s time for drama.

His long throw to Roberts, who retained control through a hit, came against a Cover-2 defense. The play was not designed to go to Roberts, Gruden said, but Carr attacked that same coverage on that same play the same way during Friday’s practice and did so again Sunday.

“You just hope in a certain situation, in a certain set that you get a certain look,” Carr said.

On fourth-and-goal, he found Carrier for a 6-yard score. Left guard Jon Feliciano (calf) and right guard Gabe Jackson (elbow, ankle) probably shouldn’t have been on the field for it. The Raiders also were on the silent count at times amid spirited Steelers fans.

Fifteen seconds remained when Roethlisberger trotted back out. He darted a short 5-yard pass to wide receiver James Washington, who lateraled to Smith-Schuster, who sprinted another 43 yards to the Raiders’ 22-yard line. On came Boswell as suspense built. Courtesy of Bermuda grass, he botched it.

“Your heart is just racing,” said linebacker Tahir Whitehead, who intercepted Dobbs. “It’s like, ‘Man, we worked so hard to get to this point, and that’s the game of football. You let up a play at the wrong point and time, and then you flip the momentum and now they have the opportunity to win the game.

“These moments are precious. We’re thankful we ended up victorious. It was destined.”