Janoris Jenkins grabs Colin Kaepernick, forcing an end-zone throw that resulted in a grounding penalty and a safety.

Photo: Dilip Vishwanat, Getty Images

Janoris Jenkins grabs Colin Kaepernick, forcing an end-zone throw...

Image 4 of 31

The Rams seemed to have the right answer for whatever Jim Harbaugh pulled from his bag of tricks.

Photo: Danny Reise, SFC

The Rams seemed to have the right answer for whatever Jim Harbaugh...

Image 5 of 31

Frank Gore (21) of the 49ers is pulled down after a short gain by James Laurinaitis (55) of the St. Louis Rams during the NFL game between the San Francisco 49ers vs the St. Louis Rams at the Edward Jones Dome in St. Louis Missouri. (Danny Reise / SPECIAL TO THE CHRONICLE)

Photo: Danny Reise, SFC

Frank Gore (21) of the 49ers is pulled down after a short gain by...

Image 6 of 31

Head coach of the 49ers Jim Harbaugh during the NFL game between the San Francisco 49ers vs the St. Louis Rams at the Edward Jones Dome in St. Louis Missouri. (Danny Reise / SPECIAL TO THE CHRONICLE)

Photo: Danny Reise, SFC

Head coach of the 49ers Jim Harbaugh during the NFL game between...

Image 7 of 31

Colin Kaepernick (7) of the 49ers sends a pass to Bruce Miller (49) of the 49ers during the NFL game between the San Francisco 49ers vs the St. Louis Rams at the Edward Jones Dome in St. Louis Missouri. (Danny Reise / SPECIAL TO THE CHRONICLE)

Photo: Danny Reise, SFC

Colin Kaepernick (7) of the 49ers sends a pass to Bruce Miller (49)...

Image 8 of 31

Patrick Willis (52) of the 49ers during the NFL game between the San Francisco 49ers vs the St. Louis Rams at the Edward Jones Dome in St. Louis Missouri. (Danny Reise / SPECIAL TO THE CHRONICLE)

Photo: Danny Reise, SFC

Patrick Willis (52) of the 49ers during the NFL game between the...

Image 9 of 31

San Francisco 49ers quarterback Colin Kaepernick is sacked for a 7-yard loss by St. Louis Rams outside linebacker Jo-Lonn Dunbar (58) and defensive end William Hayes, right, during the first quarter of an NFL football game Sunday, Dec. 2, 2012, in St. Louis.

Photo: Seth Perlman, Associated Press

San Francisco 49ers quarterback Colin Kaepernick is sacked for a...

Image 10 of 31

St. Louis Rams quarterback Sam Bradford (8) talks to teammates in the huddle during the second quarter of an NFL football game against the San Francisco 49ers Sunday, Dec. 2, 2012, in St. Louis.

Photo: Tom Gannam, Associated Press

St. Louis Rams quarterback Sam Bradford (8) talks to teammates in...

Image 11 of 31

San Francisco 49ers running back Frank Gore (21) scores on a 1-yard run during the first quarter of an NFL football game against the St. Louis Rams Sunday, Dec. 2, 2012, in St. Louis.

Photo: Seth Perlman, Associated Press

San Francisco 49ers running back Frank Gore (21) scores on a 1-yard...

Image 12 of 31

ST. LOUIS, MO - DECEMBER 2: Lance Kendricks #88 of the St. Louis Rams catches a pass against Donte Whitner #31 of the San Francisco 49ers at the Edward Jones Dome on December 2, 2012 in St. Louis, Missouri.

Photo: Dilip Vishwanat, Getty Images

ST. LOUIS, MO - DECEMBER 2: Lance Kendricks #88 of the St. Louis...

Image 13 of 31

ST. LOUIS, MO - DECEMBER 02: Cornerback Carlos Rogers #22 of the San Francisco 49ers tackles tight end Lance Kendricks #88 of the St. Louis Rams during the game at the Edward Jones Dome on December 02, 2012 in St. Louis, Missouri.

Photo: David Welker, Getty Images

ST. LOUIS, MO - DECEMBER 02: Cornerback Carlos Rogers #22 of the...

Image 14 of 31

ST. LOUIS, MO - DECEMBER 2: Colin Kaepernick #7 of the San Francisco 49ers avoids getting tackled by William Hayes #95 of the St. Louis Rams at the Edward Jones Dome on December 2, 2012 in St. Louis, Missouri.

Photo: Dilip Vishwanat, Getty Images

ST. LOUIS, MO - DECEMBER 2: Colin Kaepernick #7 of the San...

Image 15 of 31

Patrick Willis (52) of the 49ers during the NFL game between the San Francisco 49ers vs the St. Louis Rams at the Edward Jones Dome in St. Louis Missouri. (Danny Reise / SPECIAL TO THE CHRONICLE)

Photo: Danny Reise, SFC

Patrick Willis (52) of the 49ers during the NFL game between the...

Image 16 of 31

Chris Givens (13) of the St. Louis Rams breaks free from a tackle by Carlos Rogers (22) of the 49ers during the NFL game between the San Francisco 49ers vs the St. Louis Rams at the Edward Jones Dome in St. Louis Missouri. (Danny Reise / SPECIAL TO THE CHRONICLE)

Photo: Danny Reise, SFC

Chris Givens (13) of the St. Louis Rams breaks free from a tackle...

Image 17 of 31

San Francisco 49ers running back Frank Gore runs for a 23-yard gain during the first quarter of an NFL football game against the St. Louis Rams Sunday, Dec. 2, 2012, in St. Louis.

Photo: Tom Gannam, Associated Press

San Francisco 49ers running back Frank Gore runs for a 23-yard gain...

Image 18 of 31

San Francisco 49ers inside linebacker NaVorro Bowman (53) takes up his position as St. Louis Rams quarterback Sam Bradford (8) prepares for the play during the first quarter of an NFL football game Sunday, Dec. 2, 2012, in St. Louis.

Photo: Tom Gannam, Associated Press

San Francisco 49ers inside linebacker NaVorro Bowman (53) takes up...

Image 19 of 31

San Francisco 49ers quarterback Colin Kaepernick warms up before the start of an NFL football game between the St. Louis Rams and the San Francisco 49ers Sunday, Dec. 2, 2012, in St. Louis.

Photo: Tom Gannam, Associated Press

San Francisco 49ers quarterback Colin Kaepernick warms up before...

Image 20 of 31

San Francisco 49ers running back Frank Gore runs for a 23-yard gain during the first quarter of an NFL football game against the St. Louis Rams Sunday, Dec. 2, 2012, in St. Louis.

Photo: Tom Gannam, Associated Press

San Francisco 49ers running back Frank Gore runs for a 23-yard gain...

Image 21 of 31

St. Louis Rams quarterback Sam Bradford (8) hands off to running back Steven Jackson during the first quarter of an NFL football game against the San Francisco 49ers Sunday, Dec. 2, 2012, in St. Louis.

Photo: Tom Gannam, Associated Press

St. Louis Rams quarterback Sam Bradford (8) hands off to running...

Image 22 of 31

San Francisco 49ers quarterback Colin Kaepernick drops back to pass during the first quarter of an NFL football game against the St. Louis Rams Sunday, Dec. 2, 2012, in St. Louis.

Photo: Jeff Roberson, Associated Press

San Francisco 49ers quarterback Colin Kaepernick drops back to pass...

Image 23 of 31

St. Louis Rams running back Steven Jackson warms up before the start of an NFL football game between the St. Louis Rams and the San Francisco 49ers Sunday, Dec. 2, 2012, in St. Louis.

Photo: Seth Perlman, Associated Press

St. Louis Rams running back Steven Jackson warms up before the...

Image 24 of 31

San Francisco 49ers running back Frank Gore, left, scores on a 1-yard run past St. Louis Rams linebacker Josh Hull during the first quarter of an NFL football game on Sunday, Dec. 2, 2012, in St. Louis.

Photo: Tom Gannam, Associated Press

San Francisco 49ers running back Frank Gore, left, scores on a...

Image 25 of 31

San Francisco 49ers linebacker Tavares Gooden takes up his position during the first quarter of an NFL football game against the St. Louis Rams Sunday, Dec. 2, 2012, in St. Louis.

Photo: Tom Gannam, Associated Press

San Francisco 49ers linebacker Tavares Gooden takes up his position...

Image 26 of 31

San Francisco 49ers outside linebacker Ahmad Brooks takes up his position during the first quarter of an NFL football game against the St. Louis Rams Sunday, Dec. 2, 2012, in St. Louis.

Photo: Tom Gannam, Associated Press

San Francisco 49ers outside linebacker Ahmad Brooks takes up his...

Image 27 of 31

St. Louis Rams quarterback Sam Bradford drops back to pass during the first quarter of an NFL football game against the San Francisco 49ers Sunday, Dec. 2, 2012, in St. Louis.

Photo: Tom Gannam, Associated Press

St. Louis Rams quarterback Sam Bradford drops back to pass during...

Image 28 of 31

St. Louis Rams quarterback Sam Bradford, right, and tight end Cory Harkey after the Rams 16-13 victory over the San Francisco 49ers in overtime of an NFL football game Sunday, Dec. 2, 2012, in St. Louis. (AP Photo/Seth Perlman)

Photo: Seth Perlman, Associated Press

St. Louis Rams quarterback Sam Bradford, right, and tight end Cory...

Image 29 of 31

: Patrick Willis (52) of the 49ers, Donte Whitner (31) of the 49ers, and Delanie Walker (46) of the 49ers walk off of the field at the end of the NFL game between the San Francisco 49ers vs the St. Louis Rams at the Edward Jones Dome in St. Louis Missouri. By Danny Reise/SPECIAL TO THE CHRONICLE

Photo: Danny Reise, SFC

: Patrick Willis (52) of the 49ers, Donte Whitner (31) of the...

Image 30 of 31

St. Louis Rams running back Steven Jackson, left, runs with the ball for a 22-yard gain as San Francisco 49ers cornerback Carlos Rogers defends during the third quarter of an NFL football game, Sunday, Dec. 2, 2012, in St. Louis. The Rams won 16-13 in overtime. (AP Photo/Jeff Roberson)

Photo: Jeff Roberson, Associated Press

St. Louis Rams running back Steven Jackson, left, runs with the...

Image 31 of 31

San Francisco 49ers wide receiver Ted Ginn is unable to pick up a fumble by quarterback Colin Kaepernick during the second half of an NFL football game against the St. Louis Rams, Sunday, Dec. 2, 2012, in St. Louis. Rams' Janoris Jenkins recovered the fumble and took it in for a touchdown. (AP Photo/Seth Perlman)

When it was over, and the Rams had pulled off a 16-13 overtime shocker Sunday, the 49ers were in agreement after managing six points in the final 62 minutes and 32 seconds: Those guys knew what was coming.

"It seemed like everything they called," left tackle Joe Staley said, "was the best call they could have as a defense."

Said quarterback Colin Kaepernick, whose star dulled slightly after he posted a so-so rating (83.9) and committed an ugly, momentum-shifting fourth-quarter turnover in his third career start: "It seems like they were in the right defense for the things we tried to do."

For the second time in four games, the Rams (5-6-1), a year removed from a 2-14 season, gave the defending NFC West champions fits. This time, however, St. Louis also gave them a loss as rocket-legged rookie Greg Zuerlein hammered a 54-yard field goal with 26 seconds left in overtime, a kick that ensured the teams wouldn't reprise their 24-24 tie of Nov. 11.

"I think the perception was that, well, we might've caught them on a bad day," St. Louis head coach Jeff Fisher said of their first meeting. "So we got to start over again and find a way to beat the team to beat in our division."

Fisher, a defensive-minded coach in his first season with St. Louis, and his staff helped his players do just that.

The Rams entered ranked fourth in the NFL with 31 sacks, and their relentless defensive front silenced San Francisco (8-3-1) after it took a 7-0 lead on Frank Gore's 1-yard run late in the first quarter. The 49ers' next six drives netted four first downs and 35 yards, and St. Louis' defense, which collected a third-quarter safety, scored more points than San Francisco's sputtering attack.

Gore, who had 34 yards on his first three runs, had 24 yards on his final 20 carries. Meanwhile, Kaepernick, who was sacked three times, didn't have time to locate his downfield targets: 13 of his 21 completions gained fewer than 10 yards, and just two gained more than 20.

"Their defensive front gets after it," tight end Delanie Walker said. "Those guys are explosive and fast and got pressure on Kaep. They messed up some of our timing plays. ... They were pressuring him, so we couldn't get the deep throws that we wanted."

The Rams' pressure swung the momentum with the 49ers clinging to a 10-2 lead with just more than three minutes left in regulation. On 3rd-and-3 from San Francisco's 17, Kaepernick tossed a read-option pitch over the head of wide receiver Ted Ginn Jr., who was lined up behind Gore in the backfield. St. Louis brought a blitz on the play, which forced Kaepernick to hastily make the wayward toss, and the ball was grabbed near the end zone by St. Louis cornerback Janoris Jenkins and taken into the end zone.

Head coach Jim Harbaugh acknowledged the blitz "threw the rhythm and timing off."

"Our defensive staff made a great call on that third down," Rams middle linebacker James Laurinaitis said. "It was the perfect pressure and the perfect play."

Kaepernick rebounded and ripped off a 50-yard run on San Francisco's next drive to set up a go-ahead, 33-yard field goal by David Akers with 1:34 left. The Rams, however, roared right back on a last-gasp drive keyed by scrambles of 14 and 11 yards by quarterback Sam Bradford. As time expired, Zuerlein pounded a 53-yarder to send the game to overtime.

In the extra session, Akers missed a 51-yard try with 4:16 left to set the stage for Zuerlein's kick, which gave the Rams their second win in their past 10 meetings against the 49ers.

The victory sent a message that at least one team might have figured out San Francisco's offensive scheme, which features an endless array of formations, personnel groups, shifts and power-run plays.

The 49ers' rivalry with Seattle, led by another defensive-minded head coach, Pete Carroll, still qualifies as the NFC West's hottest, thanks in part to the history between Harbaugh and Carroll.

The Rams at least entered the conversation with Sunday's win. And a subtle dig from Fisher in the aftermath should help fuel the budding rivalry.

"I don't know what they were trying to accomplish there," Fisher said when asked about the 49ers' botched read option, "but we took advantage of one of their mistakes."

Inside

Just to the right:Kicker David Akers says he feels "horrible" after missing a 51-yard field-goal attempt in overtime.

Pitch-imperfect: Risky play call late in fourth quarter turns game in Rams' favor. B9