What with all the attention paid to Gregory Polanco in the past six months, his first major league homer might have lacked the necessary gravitas had it come in the fourth inning of some random game. The occasion Friday seemed appropriate.

Polanco’s first career home run gave the Pirates an 8-6 win in 13 innings against the Miami Marlins Friday night at Marlins Park, a game the Pirates had all but locked up until the bullpen gave it back in the ninth.

“That could have been a coming-out party for him,” Pirates manager Clint Hurdle said.

Clint Barmes singled off left-hander Mike Dunn in the 13th before Polanco hit a 2-2 slider into the seats in right-center field. It was part of Polanco’s 5-for-7 performance at the plate in his fourth major league game, and his mother had traveled from the Dominican Republic to attend it.

“This is my best game ever,” Polanco said. “The first time she’s here watching me play. I was so excited.”

After Jeff Locke didn’t walk a batter for eight innings, three Pirates relievers issued six walks — one intentional to load the bases — in the ninth that allowed the Marlins to score four runs and tie the score.

Justin Wilson inherited a four-run lead in the ninth but walked two. Jason Grilli entered and walked another before yielding an RBI groundout to Ed Lucas. He walked one more before Reed Johnson hit a two-run single on an 0-2 pitch.

Grilli intentionally walked Giancarlo Stanton, who was a triple shy of the cycle, to load the bases for Casey McGehee, and Hurdle brought in Mark Melancon. Melancon had McGehee down in the count, 0-2, but walked him to drive in the tying run.

“Nobody’s going out there to walk guys,” Hurdle said. “People are going out to get outs. It didn’t happen.”

Jeanmar Gomez earned the win in relief. He allowed one hit in four scoreless innings and struck out four, using his fastball to great effect.