SAN FRANCISCO — Week by week, piece by piece, the 49ers seem to be getting back to where they believe they belong: contending for another Super Bowl run.

With wide receiver Michael Crabtree making his 2013 season debut and the defense continuing its dominance over less-than-stellar opponents, the Niners thumped the St. Louis Rams 23-13 at Candlestick Park on Sunday — it wasn't as close as it sounds — and ended the evening with a foothold on the sixth NFC playoff spot thanks to a loss by the Arizona Cardinals.

Next week will provide a tougher test, though. The 49ers' late-season surge will be either confirmed or exposed next Sunday when they host the NFC West-leading Seahawks, a team that embarrassed the Niners at Seattle in Week 2.

"It's a test of who we are as a football team, a test of our character," linebacker Patrick Willis said of the upcoming stretch run. "It's easy to play games ... when you know you pretty much have clinched your division and have a playoff berth. But this is a test of who we are as a football team. Our back is against the wall and every game matters."

If the St. Louis game was a warm-up, the 49ers handled it efficiently. They held the visitors to 122 total yards and seven first downs in building a 23-6 lead through three quarters, before going on cruise control in the final period. The Rams had their moments on either side of the ball, but never seemed truly capable of pulling off an upset like the ones they perpetrated last year, when they tied the 49ers here and beat them in St. Louis.

The Rams scored on a pass from Kellen Clemens to Brian Quick with 18 seconds left in the game to make the final tally respectable.

Before that, the 49ers controlled the action, scoring the first three times they had the ball and forcing St. Louis into consecutive three-and-outs to build a 13-0 lead. And when the Rams sneaked back into the game with a couple field goals, the Niners responded with a long third-quarter field-goal drive and an early-fourth-quarter touchdown to ice the game.

A familiar tendency to settle for field goals might be a concern, but at least kicker Phil Dawson was up to the challenge, connecting on all three of his field-goal tries.

Most encouraging for the 49ers was the resurgence of a passing attack that entered the game ranked dead last in the NFL in yards per game. Colin Kaepernick, rolling out and scrambling more than we've seen lately, completed 19 of 28 passes for 275 yards and a touchdown against St. Louis, his most productive day since he torched the Packers for 412 yards in the season opener.

Certainly, the return of Crabtree from a torn Achilles' tendon was a huge factor. He was clearly Kaepernick's favorite target last year, the quarterback's first as a starter, and he seemed to open up the field for the 49ers' other targets Sunday. Wide receiver Anquan Boldin led everyone with nine catches for 98 yards, and tight end Vernon Davis caught four for 82 yards and a touchdown.

Davis briefly dabbled in curling before the 2010 Winter Olympics in Vancouver. Perhaps he should consider a Summer Games appearance as a hurdler. Late in the first quarter, Davis caught a pass from Kaepernick and smoothly leaped over a Rams defensive back en route to a 20-yard gain; that helped set up a 43-yard Dawson field goal. Early in the fourth quarter, Davis went airborne again and flew foot-first past St. Louis' Janoris Jenkins for a touchdown.

"Pretty much my whole career, anytime that I get the ball in my hands, defenders are coming for my knees," Davis said. "It was at that moment. I just said, I'm gonna jump over the guy."

Davis said no one on the 49ers has scolded him for endangering his body with those mid-play hurdles. "I probably wouldn't listen to it if they told me that," he added. "Look, I'm out here to make plays. I don't think anything can go wrong."

Boldin's advice: "Stay on the ground."

Crabtree looked like a decoy for much of the afternoon, but got into the mix with a 60-yard catch-and-run late in the third quarter. That matched the longest reception of his five-year pro career.

Sunday's game was a feisty one, with four personal fouls or unnecessary-roughness calls (two against either team), and a lot of pushing and jawing after plays. Much of it seemed to be instigated by the Rams, who brought an underdog's mentality into the contest. All in all, the 49ers felt they did a good job ignoring the bait.

"Whenever you're in games like that, you just have to keep your head," Boldin said. "You can play physical, you can play tough, but you don't want to hurt your team in the end."

There will be other tests of the 49ers' poise, and tests of their talent as well — beginning with the Seahawks game. At least Jim Harbaugh's team feels it has regained some momentum at just the right time.

"It's December," Davis said. "We all know that December's about winning."

You can reach Staff Writer Phil Barber at 521-5263 or phil.barber@pressdemocrat.com.