SAN FRANCISCO -

Pinch-hitter Marcell Ozuna's two-run single gave Tom Koehler his first victory in nine career starts, and the Miami Marlins rallied past the San Francisco Giants 2-1 Thursday night.

Ozuna's line drive to right field in the eighth inning off reliever Jeremy Affeldt (1-3) ended Koehler's struggles. After six appearances in the bullpen, Koehler (1-5) had been winless in seven starts this season -- and took the loss in his lone start last year -- for the worst team in the majors.

Giants starter Chad Gaudin tossed 4 1-3 scoreless innings but left the game after taking a hard line drive off his right throwing elbow. The team said he had a bruised elbow.

Joaquin Arias' RBI triple put San Francisco up 1-0 in the seventh.