DENVER — Kelby Tomlinson won't be penalized for being picked off first base earlier in the game.

That fine has been officially waived by manager Bruce Bochy. His big hit was payment enough.

Tomlinson lined a one-out, tiebreaking single in the ninth and the San Francisco Giants rallied to beat the Colorado Rockies 3-2 on Tuesday night.

"Just hoping to get a pitch that I could handle and get it in play there," said Tomlinson, who was called up from Triple-A Sacramento last week.

Moments before that, Tomlinson tried to lay down a suicide squeeze. But he popped it into foul territory where it just eluded the diving attempt of Gerardo Parra. In the fifth, Tomlinson couldn't scramble back to the bag in time and was picked off.

"It's frustrating, but to be able to kind of help and make up for it is always good to get that opportunity," Tomlinson said.

Eduardo Nunez had a solo homer in the third and a game-tying RBI groundout in the eighth.

Javier Lopez (1-2) got one out in the eighth to earn the win. Santiago Casilla pitched the ninth for his 31st save. He got Parra to hit into a double play to end the game.

Buster Posey began the top of the ninth by hitting a grounder to shortstop Daniel Descalso, who overthrew first baseman Parra and allowed Posey to cruise into second. Hunter Pence followed with an infield single off closer Adam Ottavino (0-2), who was then replaced by lefty Boone Logan.

After Brandon Crawford struck out, Tomlinson lined an 0-2 fastball into left field to bring home Posey with the decisive run.

"That's what it's about — the guys picking each other up," Bochy said. "Kelby did tonight for us."

It's a toss Descalso would love to have back.

"I just didn't make a good throw at a bad time in the game," Descalso said. "I made that throw thousands of times. It sailed on me there and nobody feels worse than me — putting the guy on second base there. I feel like it cost us the game tonight."

The Giants finished with eight hits, breaking a string of five straight games in which they have been held to four or fewer. The Giants are hitting .124 over their last six games.

DJ LeMahieu added a two-out, infield single in the third in which Raimel Tapia kept on running from second to score. Tapia had a sacrifice fly in the fifth.

Colorado's Tyler Anderson and Jeff Samardzija were locked in a pitcher's duel most of the game.

Anderson threw 7 1/3 crisp innings, giving up two runs and six hits. The lefty with a deceiving hitch in his delivery has a 3.04 ERA at Coors Field this season.

Samardzija matched the rookie's performance as he allowed two runs and four hits in seven innings. Samardzija struck out nine.

"That's what it's all about, especially in September — got to find a way to win," Samardzija said.

Anderson ran into trouble in the eighth by surrendering singles to Gorkys Hernandez and Trevor Brown. After a sacrifice bunt, Anderson was taken out for Jordan Lyles. Nunez grounded out to short to bring home the tying run.

Nunez's solo shot in the third was a rare homer for the Giants, who have 37 since All-Star break — the second-fewest in the league.

LeMahieu, who is in a close race for the NL batting title with Washington's Daniel Murphy, went 3 for 4 on Tuesday and raised his average to .343.

TRAINER'S ROOM

Giants: RHP Jake Peavy (strained lower back) threw a bullpen session Monday and could be activated off the DL on Wednesday. ... Bochy gave INF Joe Panik and OF Denard Span a night off.

Rockies: OF Charlie Blackmon missed a fourth straight game with tightness in his lower back. "He's definitely closer," manager Walt Weiss said. ... OF Ryan Raburn's bruised left foot remains sore, Weiss said.

ROSTER MOVES

The Rockies recalled RHPs Eddie Butler and German Marquez, along with C Dustin Garneau. They also selected the contracts of INF Pat Valaika and OF Jordan Patterson.

To make room, the team designated INFs Ben Paulsen and Rafael Ynoa for assignment.

UP NEXT

Giants RHP Albert Suarez (3-3) will make his ninth major league start Wednesday in the final game of the series. The Rockies will throw LHP Jorge De La Rosa (8-7).