Brian Westbrook, coming in for injured running back Frank Gore, had 136 rushing yards to help the 49ers climb within a game of first place in the West despite owning a 4-7 record.
After starting the season 0-5, San Francisco now have a real chance of making the playoffs for the first time since 2002 as the two teams above them in the division -- St Louis and Seattle -- have 5-6 records.
Westbrook had carried the ball just five times prior to Monday's game but he took his chance when Gore went down with a hip ailment in the first quarter.
"I was fresh, only having five carries," Westbrook told reporters after he recorded his first 100-yard rushing game since 2008. "I try to go out there and get ready every single week and this week I got the opportunity."
Gore returned to the game briefly but Westbrook handled the load, taking 23 carries and recording an eight-yard score in the first half where San Francisco claimed a 21-6 lead.
Michael Crabtree caught a 38-yard touchdown pass from Troy Smith for the opening score just over five minutes into the game, and Anthony Dixon added a one-yard touchdown as the 49ers led 14-3 after the first quarter.
Quarterback Troy Smith improved to 3-1 since becoming the starter in place of Alex Smith, and San Francisco finished with 261 yards on the ground to control the clock.
Arizona's (3-8) offense could manage only two field goals as the Cards slid to their sixth successive defeat, their longest losing streak since dropping eight in a row in 2006.
Arizona quarterback Derek Anderson completed just 16 of 35 passes with an interception. Following the game he responded angrily to a reporter who asked why he was seen smiling on the sidelines during the loss.