SAN FRANCISCO -

Carlos Beltran heard boos every time he came to the plate on Saturday at AT&T Park.

Then he did something to make it worse: He got hits.

Beltran exacted a bit of revenge against his former part-time employer, driving in three runs, two on a tiebreaking, two-out single in a three-run fifth inning, lifting the St. Louis Cardinals to a 6-3 victory over the San Francisco Giants.

"Of course (I heard the boos). I'm not deaf," the Cardinals right fielder said after getting his first RBI of the season. "There's not a person in the world who likes to be booed, but it's part of the game. You have to deal with it."

Beltran's productive afternoon came on a day the Giants set aside to honor catcher Buster Posey, presenting him his 2012 National League Most Valuable Player plaque in an on-field ceremony immediate preceding the game's first pitch.

With Posey out with a broken leg, Beltran played 44 games for the Giants as a rental player in the stretch run of the 2011 season in the club's unsuccessful bid to catch the Arizona Diamondbacks for the National League West title. The Giants' 167th consecutive sellout vented its frustration on him, unwilling to forget his inability to be a difference-maker two years ago.

"I'm not trying to beat the fans," Beltran said. "I'm trying to beat the team."

The switch-hitter certainly was a difference-maker Saturday, first snapping the Giants starting pitchers' season-opening streak of innings without allowing an earned run at 26 2/3 with a two-out RBI single in the first inning that plated Matt Carpenter.

But it was the fifth-inning shot into right field that brought home Carpenter and Matt Holliday and broke a 2-2 tie that Giants fans had envisioned when Beltran was acquired on July 28, 2011.

Beltran, who left the club as a free agent that off-season, signing with the Cardinals, began the day hitting .100 as St. Louis had lost three of its first four.

"Today was a game where we scored a lot with two outs. That's big for any team," said Beltran, whose two run-producing hits both came with two down. "We've got a lot of guys here who take a lot of pride hitting in those situations.

"This is a good team, man. Guys from top to bottom who can do the job. It's fun as a player, you just want to be part of it."

Shelby Miller (1-0), who moved into the starting rotation this season with Chris Carpenter out because of shoulder issues, survived an early Hunter Pence homer to post a win in his just second career start, his first on the road. He struck out four in 5 1/3 innings and got a lot of help not only from Beltran but also four relievers, with Mitchell Boggs notching his first save of the season in a four-batter ninth inning.

"The offense was swinging great today," said Miller, who watched Jake Westbrook's impressive performance go for naught in Friday's 1-0 loss in the series opener. "We have one of the best lineups in the league."

Pablo Sandoval's second home run of the young season, off the Cardinals' fourth pitcher, Edward Mujica, got the Giants within 5-3 in the eighth and kept San Francisco's hopes alive for a fourth consecutive win.

When Posey smacked the next pitch off the right-field wall for a double, the Giants were able to bring the potential tying run to the plate three times in the inning, but Mujica escaped further damage.

"I thought it had a chance (to be a home run)," Posey said of his only hit in four at-bats. "It's hard to tell here sometimes."

Other than the defeat, it was a memorable day for the seventh MVP in Giants history.

"It means a lot to be able to celebrate that with the fans," Posey said. "And having my family here. I was able to share it with my family, too."

Carpenter's ninth-inning single off Javier Lopez brought home Shane Robinson with a Cardinals insurance run.

Ryan Vogelsong (0-1) gave up both of Beltran's run-producing hits and took the loss, lasting 5 1/3 innings.

Two infield hits set the stage for Beltran in the Cardinals' fifth.

With St. Louis down 2-1, No. 8 hitter Pete Kozma reached base to lead off the uprising when shortstop Brandon Crawford's long throw from the hole skidded on the wet grass and handcuffed Giants first baseman Brandon Belt. Kozma was credited with a hit.

After a two-out walk to Carpenter, Holliday got St. Louis even with a grounder into left field, scoring Kozma.

Vogelsong appeared to get out of the inning when he got Allen Craig to ground meekly to the left side of the infield, but Sandoval, the Giants' third baseman, had the ball deflect off his glove as he dived in front of Crawford.