SAN FRANCISCO (AP) — Matt Duffy homered and drove in three runs to help the San Francisco Giants snap a nine-game home losing streak by beating the Seattle Mariners 6-2 on Tuesday.

Casey McGehee added a two-run double and Angel Pagan hit an RBI single as the Giants snapped their longest home skid since an 11-gamer at New York's Polo Grounds in 1940. Tim Lincecum (7-3) allowed two runs and five hits in 5 2/3 innings to get the win in his second start against his hometown team.

Brad Miller homered and drove in two runs for the Mariners, who split the two-game series in San Francisco and finished 4-4 on an eight-game road trip.

San Francisco had scored just 17 runs during the home skid and had not homered in five straight games here before Duffy went deep in the second inning against J.A. Happ (3-3).