Updated

The Miami Marlins hope to continue their recent mastery of the San Francisco Giants on Friday when the two resume a four-game series from AT&T Park.

Miami beat the Giants for the eighth straight time in San Francisco on Thursday, as pinch-hitter Marcell Ozuna delivered the go-ahead single in the top of the eighth to carry the Marlins to a 2-1 win.

Sandy Rosario, who had already thrown 2 1/3 shutout innings, started the inning for the Giants. However, after walking Justin Ruggiano, Jeremy Affeldt (1-3) came in relief.

He hit Derek Dietrich with a pitch before Adeiny Hechavarria moved the runners into scoring position with a sacrifice bunt. Ozuna's single to right brought Ruggiano and Dietrich home to give the Marlins the lead.

Chad Qualls was perfect in the eighth and Steve Cishek notched his 11th save with a scoreless ninth.

Miami starter Tom Koehler (1-5) carried a no-hitter into the sixth before giving up a one-out single to Gregor Blanco. He allowed one run on three hits and three walks over seven frames.

"I think we've been fighting all year and now the offense is coming along," said Koehler. "I think we're going to put up a couple of good runs and surprise some people."

Miami's success in the Bay Area could continue on Friday with right-hander Ricky Nolasco on the hill. Nolasco has won four of his last five decisions against the Giants and his overall 1.83 ERA against them is his lowest against any team he has faced more than twice.

Nolasco's been almost unhittable at AT&T Park, where he is 4-0 with a sparkling 0.87 ERA in four starts.

"I wish I could tell you what it was," Nolasco said. "If I knew what it was, I'd try to do it in every ballpark."

Nolasco beat the St. Louis Cardinals on Sunday, as he held them to a run and three hits in seven innings to up his record to just 4-7 on the year to go along with a 3.61 ERA.

San Francisco, meanwhile, will hand the ball to former two-time NL Cy Young Award winner Tim Lincecum, who is 4-7 with a 4.57 ERA. Lincecum lost for the fifth time in six starts on Sunday in Atlanta, as he allowed three runs (2 earned) and six hits in six innings. He also walked five batters in the setback.

"I was proud of how he battled out there," Giants manager Bruce Bochy said. "He didn't let the game get away from us. He ended up throwing a pretty good game. We just didn't do anything with the bats."

He is 2-1 in four starts versus the Marlins with a 3.67 ERA.

The Marlins, who haven't lost in San Fran since July 28, 2010, claimed five of their seven meetings with Giants last year. They haven't lost a series in San Francisco since they dropped two of three in July 2009.