"Our team has now hung in in a lot of big-time pressure games," Harbaugh said. "They've overcome adversity. They've shown they can do that."
"We can win a shootout," Crabtree said. "Whatever it takes, that's our motto. ... We feel like we can do anything, sky's the limit."
The 49ers (10-3-1) own at least a wild-card spot and play at Seattle next week with a chance to win the NFC West. A loss would bring the division race down to the final weekend.
Kaepernick threw for four touchdowns, two to Crabtree, who had 107 yards receiving. The defense rattled Tom Brady at times, but also yielded 443 yards passing in a sloppy contest between two of the league's more precise teams.
AFC East champion New England (10-4), which had won seven in a row, trailed 31-3 in the third quarter and lost for the first time at home in December in 21 games. The Patriots also had won 21 in a row in the second half of the schedule before San Francisco somehow regrouped late in a game it seemingly had clinched long before.
"I used to live next to a train station in Chicago," Harbaugh said. "And it's like the more you hear the train, the less you hear it. I feel that way with our team in terms of pressure in big games. The more you feel it, the less you feel it."
San Francisco forced four turnovers, matching the number of giveaways New England had at home all season.
And just like that, San Francisco went in front again.
Rookie LaMichael James broke free for a 62-yard kickoff return. On the next snap -- the third time the Niners would have a one-play TD drive -- Crabtree took a pass on the left side, spun and headed into the end zone.
"We faced adversity," James said. "Nobody flinched."
San Francisco led 17-3 at the half. And they looked safe after Frank Gore picked up Kaepernick's third fumble and scored on a 9-yard run, followed by Crabtree's 27-yard score in a pinpoint pass from the second-year quarterback.
The defense set up both of San Francisco's TDs in the third.
Dashon Goldson returned Steven Ridley's fumble 66 yards to the New England 3 before Gore found the end zone. Defensive end Aldon Smith, known for his sacks, grabbed a pass out of Hernandez's hands for his first career interception. After he was tackled, Smith ran directly to the sideline and sat down on the 49ers' bench.
He was back up on his feet cheering the next play, when Crabtree broke free to make it 31-3.
"We just spotted them 28 points," Brady said. "We fought hard, but you can't play poorly against a good team and expect to win. We can't miss plays that we have opportunities with."
Unlike a week ago, when the Patriots routed Houston, they fell behind quickly in the rain and ran only 10 snaps on their opening three series. San Francisco's fearsome pass rush was sharp then, and Brady was hit on the arm twice while trying to pass.
Earlier, Kaepernick accounted for 60 yards through the air on the 49ers' first drive. Randy Moss showed the kind of elusiveness that made him a record-setter in New England from 2007 until he was traded early in the 2010 by getting behind the secondary for a 24-yard TD.
His short celebration as he faced the crowd drew loud hoots.
All this from teams ranked 1-2 in fewest giveaways.
"We just didn't even give ourselves a chance," Brady said.
San Francisco answered quickly, helped by a 35-yard pass interference call on Aqib Talib. Walker slipped behind a zone defense for a 34-yard TD pass from Kaepernick, making it 14-3.
Akers made a 20-yard field goal as the half ended, finishing a 15-play, 76-yard drive. The three points were the Patriots' fewest in a half all season, and they were outgained 249-113.
Of course, that turned around in the second half.
NOTES: Welker now has 100 catches this season, the fifth time he has reached that number, an NFL record. ... New England has 506 points, the fourth time it has reached 500, also a league mark. ... San Francisco had allowed only 184 points going into the game, lowest in the league. ... Andy Lee averaged 54 yards net on five punts for the 49ers. ... Brady's 65 throws are a career high. ... Brandon Lloyd had 10 catches for 190 yards for New England.
Copyright 2012 by The Associated Press