Updated

Pittsburgh, PA (SportsNetwork.com) - Gerrit Cole tossed eight solid innings as the Pittsburgh Pirates edged the San Francisco Giants 4-3 at PNC Park.

Cole (3-2) gave up three runs on seven hits, walked one and struck out seven.

Ike Davis had three hits and Travis Snider finished 2-for-3 with a walk and two RBI as the Pirates concluded this three-game series with a second straight win.

"It's a confidence booster," Cole said. "We've been close a lot and to be able to see things click and come together for us, it's been nice."

Brandon Belt knocked in all three runs for the Giants, while Tim Lincecum (2-2) allowed four runs on eight hits and walked two in four frames.

San Francisco had its six-game winning streak snapped on Tuesday.

The Pirates responded to Belt's solo homer to center field in the first with a pair of runs in the bottom of the inning.

Snider led off with a walk and scored on Andrew McCutchen's one-out single to right. Starling Marte then plated McCutchen with a two-out double to left.

"I just wasn't finishing my pitches," said Lincecum. "Things were just rolling into the zone."

Pittsburgh extended its lead to 4-1 in the second. Chris Stewart and Cole hit consecutive one-out singles and Snider drove in both with a base hit to right after Lincecum threw a wild pitch.

Cole pitched out of a second-and-third jam in the fourth, but the Giants trimmed their deficit in the next inning.

Belt doubled to the right-field corner with two outs to score pinch-hitter Pablo Sandoval, who singled, and Hunter Pence, who walked. Belt was tagged out at third base trying to advance on the throw home.

Cole allowed only one more hit during his outing, and Mark Melancon earned his second save with a 1-2-3 ninth.

Game Notes

Cole made his Major League debut against San Francisco at PNC Park on June 11 last season ... The Pirates have won six of the last eight meetings with the Giants at PNC Park ... The Giants top the majors in one-run games this season with 18.