The two up-and-coming teams that have struggled in recent years became the last to play on the NFL's opening weekend.
Arizona got off to an inauspicious start when Leinart threw an interception on the Cardinals' first play from scrimmage. Walt Harris stepped in front of Leinart's pass to Larry Fitzgerald and returned the interception 23 yards to the 6.
Two plays later, Gore ran right up the middle for the score with help from a key block by tight end Vernon Davis.
The Cardinals struggled to get their offense going after that, but were helped by a running-into-the-kicker penalty on Keith Lewis that extended a drive late in the quarter, moving Arizona into San Francisco territory for the first time.
The 49ers were unable to move the ball on their other two drives as the defenses surprisingly were in control of the game.
The Cardinals have won four straight against the 49ers since losing twice to San Francisco in 2004. Those were the 49ers' only wins that season and gave them the top pick in the draft they used on Smith. Many San Francisco fans had hoped Leinart would leave Southern California a year early after winning the Heisman Trophy and come to San Francisco.
Leinart stayed at USC for his senior year and fell all the way to Arizona at No. 10 in last year's draft.
