ST. LOUIS -- Giants third baseman Pablo Sandoval has been playing in pain for most the season, so when he fouled the ball off the top of his right foot in the first inning at Busch Stadium on Friday night, it was more of the same.

The man they call Panda writhed on the ground for several long minutes. He remained in the game and went on to hit his second homer of the National League Championship Series seven innings later.

NLCS

"When you get hit like that in the foot, you're going to be sore, so you have to prepare your mind in a situation like that," Sandoval said after the Giants beat the Cardinals, 5-0, in Game 5 and now trail St. Louis, 3-2, in the best-of-seven series. "You have to keep moving around so it's less cold, too."

Sandoval missed six weeks during the first half of the regular season after having surgery to repair a broken hamate bone in his left hand. He suffered a similar injury to his right hand a few years ago.

Sandoval was relegated to the bench in 2010 when the Giants defeated the Rangers in five games to win their first World Series title since 1954, and all this is new to him. He went 3-for-13 with an RBI on an infield grounder during the first three games of the NLCS, but since his two-run homer in the ninth inning of Thursday's Game 4 loss, Sandoval has turned things around.

He was 2-for-4 on Friday night despite the injury as the Giants made the most of six hits to defeat the defending World Series champion Cards, with Game 6 slated for 4:30 p.m. PT (FOX) at AT&T Park on Sunday.

"The last couple of games I've had to make adjustments," Sandoval said. "You get to the postseason and you see the things you did wrong during the season and all the things you do well. You have to keep focused on the things you do well."

Sandoval is fixture at third base now, and he turned in a stellar play in the first inning as St. Louis tried to get to Giants starter Barry Zito early. With a runner on second and two out, Sandoval dove across the line and made a tumbling snare of Allen Craig's foul line drive to end the inning. Zito listed it as one of the top plays made behind him in the game.

"Panda making that diving catch on the cutter into Allen Craig was awesome," said Zito, who had held the Cards scoreless on six hits over 7 2/3 innings.

Sandoval's homer against St. Louis reliever Mitchell Boggs opened the top of the eighth and provided Zito with the five-run margin.

"He's seeing the ball really well right now," Giants manager Bruce Bochy said. "He's getting some good swings off. He's a good hitter. I like where he's at right now. This is a talented guy. He's hitting in the heart of our order. And when he's seeing the ball, he's swinging well."

About the foul ball off Sandoval's foot, Bochy said: "He's fine. I think the one slide he bumped his knee and it was pretty sore there. And then he fouled a ball off his toe in that first at-bat. But he's good. He'll be all set to go when we get back home."