The Arizona Cardinals will have a tough time missing the playoffs now.

GLENDALE, Ariz. — The Arizona Cardinals will have a tough time missing the playoffs now.

The team that's been pro football's biggest loser for decades escaped with a 29-24 victory over San Francisco on Monday night to open a four-game lead in the NFC West with seven to play.

"We had to scrap and fight for everything that we got," Cardinals coach Ken Whisenhunt said. "I'm extremely excited that we came out with a win and we broke that Monday night curse."

It was Arizona's first Monday night win in six tries since the franchise moved to the desert 20 years ago.

At the finish, just a couple of yards were the difference.

The Cardinals (6-3) stopped Michael Robinson up the middle from the 2-yard line as the game ended to preserve their sixth consecutive home victory and fourth this year.

"It would have been nice to have a blowout but hey, those games are sweet when you win," Arizona quarterback Kurt Warner said. "Man, it's fun. It's fun to pull these out. It would have been a heartbreaker to have lost it."

The 49ers (2-7) lost their sixth in a row and second since Mike Singletary took over as interim coach from the fired Mike Nolan.

"That was definitely one of the most frustrating losses I can remember in my 15 or 16 years playing football," 49ers center Eric Heitmann said.

The Arizona players were just as stunned as every 49ers fan that Frank Gore didn't get the ball for that last carry.

"I told Frank after the game, he's their best player," Arizona defensive back Adrian Wilson said. "In that situation, you've got to demand the ball. To have him as a wideout, to me, that's not their best play."

Singletary said the play was called by offensive coordinator Mike Martz.

"I think Coach Martz felt that there would be a cavity inside, so he made the call," Singletary said. "So you've got to live with the result."

Who made the game-saving tackle?

"We all did," defensive tackle Darnell Dockett said.

Singletary said his team could have "done a heck of a lot better job" managing the final seconds. With the ball on the 1-yard line, Gore headed toward the winning touchdown around left end, only to stumble and fall outside the 2-yard line. After a review, officials said Gore was down by contact — when he was pushed slightly by Chike Okeafor. That set up San Francisco's frantic last play.

Warner finished 32-of-42 for 328 yards and three touchdowns without an interception.

The Cardinals never led until Karlos Dansby's 34-yard interception return set up Warner's 5-yard TD pass to Anquan Boldin with 4:16 to play.

Arizona coach Ken Whisenhunt stressed the positives, including the goal-line stand.

"We found a way to win a tough game, which is something you have to do," he said.

Shaun Hill, replacing the benched J.T. O'Sullivan for his third career start in seven NFL seasons, threw for two touchdowns in the first half but lost a fumble and threw two interceptions in the second. He finished 19-of-40 for 217 yards.

"It's very frustrating — our guys fought so hard," Hill said. "It was very frustrating that my turnovers in the second half really put the defense with their backs against the wall a couple of time."

He said he appreciated Singletary's words of encouragement after the game.

"I was sitting in my locker and he came up and patted me on the shoulder," Hill said. "...I do appreciate that. I just really wish we could have gone out and gotten a win for him, and it was out there for the taking."

Allen Rossum returned the opening kickoff 104 yards for a touchdown and the 49ers never trailed until Arizona's late score.

Rossum, who left the Seattle game two weeks ago with a hamstring injury, showed no ill effects on the opening kickoff. He caught the ball four yards deep in the end zone, then ran upfield and darted to his left, going untouched for the touchdown.

"It was very exciting, just to give our offense a lift, our team a lift," Rossum said. "We took the momentum and we controlled well over the majority of the game."

It was his fifth career kickoff return for a score and was just one yard short of the team record.

Notes: For the first time this season, the roof at University of Phoenix Stadium was open. ... Aeneas Williams was added to the Cardinals Ring of Honor at halftime. ... The longest kickoff return in San Francisco history was 105 yards by Abe Woodson against the Los Angeles Rams on Nov. 8, 1959.