In addition to having to beat the visiting San Francisco 49ers, they needed the New Orleans Saints to lose at home to the Tampa Bay Buccaneers.
Neither scenario happened on Sunday.
The 49ers got a 40-yard field goal from Phil Dawson as time expired to beat the Cardinals 23-20 at University of Phoenix Stadium.
"I hit it pretty good," Dawson said. "I didn't wait around to see how much it cleared by. Coach (Brad) Seely (special teams coordinator) asked me leading up to that before third down how I felt and I said, 'Well, I'll at least get it there,' and fortunately, that proved to be true."
Linebacker NaVorro Bowman played a major role in the 49ers' victory, getting an interception and recording a forced fumble and a fumble recovery as well as a sack.
The Saints, meanwhile, rolled over the Tampa Bay Buccaneers 42-17 behind four touchdown passes and a touchdown run by quarterback Drew Brees.
The 49ers earned the NFC's No. 5 seed and will travel to Green Bay to take on the Packers, the NFC No. 4 seed, in their first-round playoff game next Sunday.
Quarterback Carson Palmer was 28-of-49 passing for 407 yards and two touchdowns for the Cardinals and became the first quarterback in NFL history to throw for 4,000 or more yards in a season for three different teams.
He did it twice while with the Bengals and also last season for the Raiders, but it was not enough to get his team into the postseason.
"Personal goals are always nice," Palmer said, "but that wasn't one of my personal goals. I wasn't worried about it or thinking about it. I was thinking about wins and losses. ... It just took us awhile to get going today. We didn't make enough plays when it came to it."
Wide receiver Anquan Boldin, in his first game back in Arizona since leaving the Cardinals following the 2009 season, caught nine passes for 145 yards and a touchdown for the 49ers, who are headed to the playoffs for a third consecutive season under head coach Jim Harbaugh.
"It was a huge game for Anquan," Harbaugh said. "This No. 81 now is terrific. What a football player. You can sum him up right there. Football player. That pretty much summarizes everything good that you can say about a football player. He's all of it. Leadership, big-play ability, competitiveness."
Quarterback Colin Kaepernick was 21-of-34 for 306 yards and two touchdowns for San Francisco (12-4), which won its sixth straight game to end the regular season.
But it wasn't easy.
The Cardinals (10-6) fought back from a 17-0 first-quarter deficit, getting a 1-yard touchdown pass from Palmer to tight end Jake Ballard in the second quarter and a 49-yard field goal from Jay Feely early in the fourth quarter to stay in the game.
If it had not been for the Cardinals' sixth-ranked defense, the deficit could have been a lot worse. San Francisco quickly marched down the field on its opening possession and had three chances to get a touchdown from inside the 10-yard line.
The 49ers, though, were forced to settle for a 27-yard field goal from Dawson.
Bowman helped them get more, though, when he stepped in front of a Palmer pass intended for Michael Floyd and picked it off. Floyd was covered by three 49ers defenders.
Five plays later, Kaepernick found Boldin for a 4-yard touchdown pass in the right corner of the end zone for a 10-0 lead with 8:33 left in the first.
A 63-yard catch and run by Boldin on San Francisco's next possession helped set up another Kaepernick touchdown pass -- this one to tight end Vernon Davis for 3 yards to make it 17-0.
Earlier, Feely missed from 37 yards when his attempt was wide right.
A solid defensive effort by the Cardinals helped prevent yet another San Francisco score, however, and a 49-yard pass play from Palmer to Larry Fitzgerald set up a 1-yard scoring pass from Palmer to Ballard.
Dawson missed a 24-yard field goal at the end of the first half, hooking it left.
At the end of the third quarter, Arizona converted a fourth-and-1 at the 49ers' 35, keeping a drive alive long enough for Feely to connect from 49 yards early in the fourth and pull the Cardinals to within 17-10.