Neil O'Donoghue kicked a 37-yard field goal with 23 seconds remaining in the game, giving the St. Louis Cardinals a 20-17 upset today over the previously undefeated Dallas Cowboys.

O'Donoghue's kick ended a 63-yard drive in the game's closing minutes and dropped the Cowboys out of a tie for the NFC East lead. Division-leading Philadelphia, which plays Atlanta Monday, is the NFL's only unbeaten and untied team.

Going into the game, Dallas (4-1) had beaten St. Louis (2-3) seven straight times.

"I felt pretty cool," O'Donoghue said. "It was one of those situations where you feel you're going to get the opportunity . . . Everybody knew we had to win."

Jim Hart's passes of 20 yards to Doug Marsh and 19 to Roy Green sustained the winning drive after Cowboy Danny White punted out of bounds at the St. Louis 7.

"The thing that hurt us was Hart's ability to cut us up like a surgeon in the last series," Dallas safety Charlie Waters said. "He knew exactly what he wanted to do.

"It seemed almost like he'd rather have it that way than be 20 points ahead."

Just before O'Donoghue's deciding kick, Ottis Anderson rushed nine yards to the Cowboys' 20.

St. Louis had taken a 7-0 lead in the opening 18 seconds on a nine-yard run by Wayne Morris after James Jones fumbled the kickoff. Tony Dorsett countered with a seven-yard scoring run seven minutes later, but St. Louis gained a 10-7 edge on a 19-yard field goal by O'Donoghue.

A 26-yard field goal by Rafael Septien of Dallas tied it, 10-10, at halftime.

Hart threw a 30-yard touchdown pass to Green one play after Randy Love recovered Stump Mitchell's fumbled punt return. But Dallas, after rookie Michael Downs intercepted Hart in the St. Louis end zone to end a 78-yard drive, gained a 17-17 tie on White's 11-yard pass to Dorsett.

Dorsett had run for 100 yards against St. Louis in five previous games but today gained 99.

Hart finished with 16 completions in 29 attempts for 199 yards and a touchdown. His touchdown pass to Green was the 197th of Hart's 16-year career, moving him into ninth place on the all-time NFL list.