When Frank Corral's 45-yard field goal attempt drifted a few misguided feet to the east today with 17 seconds left, the San Francisco 49ers had beaten the Los Angeles Rams, 20-17.

It has been a long time since the map of California coincided with the National Football League standings at the midpoint of the season. But with a 6-2 record and a five-game winning streak, San Francisco is now above of Los Angeles not only in latitude, but also in the NFC West. "There's too much exhilaration to say something of meaning now," said 49ers Coach Bill Walsh, whose first-place team now leads Los Angeles and Atlanta, both 4-4, by two games.

History books show that the 49ers haven't been in first place this late in the season since their title year of 1972, when pioneers John Brodie and Gene Washington led the team.

They call San Francisco and Los Angeles rivals, but the 49ers hadn't defeated the Rams in five years, and the last time they had won in San Franciso was in 1966, when they beat George Allen in Kezar Stadium. The 49ers had never beaten the Rams in Candlestick Park.

Until today.

"It used to be fun to come to Candlestick for us," said Cody Jones, the Rams' 12-year veteran lineman. "This isn't the same 49er team, though . . . It's a whole new ball club."

Said 49ers tight end Charlie Young, who used to enjoy toying with San Francisco when he was a Ram from 1977-79: "Right now I think Howard Cosell will see that we belong on the halftime highlight show. When we beat Dallas (45-14), he didn't put us on the air because he didn't have any insurance that the 49ers were for real. He does now."

Los Angeles Coach Ray Malavasi said, "We beat them everywhere but in the scoring."

The 49ers led 14-0 after the first quarter, 14-13 at the half, and 20-17 after the third quarter, before both defenses held for a scoreless final quarter.

Many factors contributed to this victory. Quarterback Joe Montana completed 18 of 32 for 287 yards and two first-quarter touchdown passes, a 14-yarder to Freddie Solomon and a 41-yarder to Dwight Clark.

The defense had the sellout crowd of 59,190 dancing to the music -- "Celebration," the same tune the Oakland A's danced to. Fans call the defense the "New Name Defense," because it includes rookies Ronnie Lott, Carlton Williamson and Eric Wright in the secondary, and veteran linebacker Jack Reynolds, in his first year with the 49ers.

Lineman Fred Dean, who became another new name here when he took his big contract and pass rush from San Diego to San Francisco three weeks ago, had four sacks and contributed to a fifth today for minus-37 yards.

But perhaps the most consequential player in this San Francisco win was Corral, the Rams kicker who missed four field goals in five attempts. He botched a 49-yarder in the first quarter, had a 26-yarder blocked by Dwaine Board in the third quarter and hit the right post on a 32-yarder in the fourth quarter that would have tied it up with six minutes to play. And then there was the last one.

"This was probably the worst game I've had in my life," said Corral, who had converted 10 of 12 field goal attempts before today. "The offense gave me good field position. I just wasn't able to come up with the kick. (On the last kick) I hit it a little better than I thought I did."

The 49ers were watching that kick, too. "I thought we were going to overtime," said Clark, who caught eight passes for 109 yards. "I figured the odds were in his favor because he had missed a few before."

"I just kept hoping a strong wind would push it away," said Montana. He got no wind, but he did get the miss.

Rams quarterback Pat Haden also had problems today. "It seemed like I missed receivers by inches three or four times," said Haden, who completed 20 of 39 for 310 yards and one touchdown and had one pass intercepted.

After the 49ers scored their two first-quarter touchdowns, their point production was limited to two field goals by Ray Wersching. Wersching kicked a 42-yarder in the second quarter to make it 17-10, then kicked an 18-yarder in the third quarter to make it 20-10.

Willie Harper, the 49ers eighth-year linebacker, remembers all those years of Ram-induced frustrations.

"There were a lot of reasons why we kept losing to them, things like personalities that didn't mesh," Harper said. "But things are different now. This is a rebuilt team."