MIAMI (AP) — Chris Coghlan snapped out of a season-long slump with a tiebreaking three-run homer off Tim Lincecum in the sixth inning Friday night, and the Miami Marlins rallied past the San Francisco Giants 7-6.

Coghlan, who has shuttled between the Marlins and the minors since winning the NL Rookie of the Year award in 2009, was batting .104 when he hit his first home run since last June 11.

READ MORE: Miami Weather: Warming Trend Continues This Week

San Francisco’s Melky Cabrera, who came into the game leading the majors with 67 hits, pulled his third homer of the season just inside the right field foul pole. He also tripled, but struck out against Steve Cishek with a runner at second to end the game.

Giancarlo Stanton became the first player to hit the Marlins’ home run sculpture when he connected against Lincecum (2-5).

The Giants’ right-hander gave up six runs in 5 2-3 innings, which hiked his ERA to 6.41. He’s 0-3 in his past five starts.

The Marlins improved to 17-7 this month, best in the majors, and broke the franchise record for victories in May.

Struggling Miami closer Heath Bell entered the game to start the ninth with a 7-4 lead but got only one out and blew a save for the fifth time in 12 chances. Cishek came on with runners at second and third and one out, and after Brandon Crawford hit a sacrifice fly to make it 7-6, Cabrera was called out on a 3-2 pitch.

Cishek earned his first save in three chances. Dan Jennings (1-0) pitched a perfect sixth for his first major league win hours after being recalled from Triple-A New Orleans.

READ MORE: Pari-Mutuels Fire Back At Seminoles In Gambling Appeal

The Giants outhit Miami 14-7 but went 2 for 11 with runners in scoring position.

Miami starter Josh Johnson gave up nine hits and three runs in five innings. He remained winless in six career starts against San Francisco.

The Giants’ Omar Infante went 0 for 4 with an RBI groundout on the anniversary of his season-ending leg injury suffered in a home-plate collision against the Marlins last year.

Lincecum took a 3-1 lead into the sixth but failed to make it through the inning. Omar Infante led off with a double and scored on a single by Stanton. After the Marlins loaded the bases, John Buck’s sacrifice fly tied the game.

Coghlan then pulled an 0-1 pitch over the fence, pounding his chest with his fist as the ball landed in the right field seats. That ended Lincecum’s night.

Despite his struggles, Lincecum hadn’t given up a homer in 50 1-3 innings until Stanton connected in the fourth inning. The ball landed in the base of the sculpture for the Marlins’ first run. Center fielder Angel Pagan ran out of room near the 418-foot sign and could only watch as the animated sculpture sprung into motion.

The home run was the 10th this month for Stanton, and his 11th of the season. It was the first of his career from the cleanup spot, where he began the season before being dropped in the order when he started slowly.

MORE NEWS: Three Killed, Six Injured In Michigan School Shooting, 15-Year-Old Suspect In Custody

The Giants scored in the first when Pagan singled and later came home on a double play. They went up 2-0 in the second on singles by Gregor Blanco, Crawford and Pagan.