Clayton Richard pitched eight sparkling innings, Cameron Maybin drove in three runs and the San Diego Padres snapped a five-game losing streak with a 7-1 win over the San Francisco Giants on Sunday.

The Giants dropped out of first in the NL West and trail the Dodgers by a half-game heading into their big three-game series in Los Angeles. Madison Bumgarner is scheduled to face Dodgers ace Clayton Kershaw in the opener on Monday night.

Richard (10-12) allowed an unearned run and five hits while improving to 3-1 with a 2.02 ERA in his last five starts. The left-hander was 0-3 with a 7.64 ERA in his three previous starts against San Francisco this season.

Maybin tied his career high with four hits, including a two-run single in the first inning when the Padres scored three times against Ryan Vogelsong (10-7). Everth Cabrera and Will Venable had three hits apiece and San Diego finished with 16 overall while avoiding matching its longest losing streak of the season.

San Francisco had scored 22 times and collected 37 hits in three games since outfielder Melky Cabrera was suspended on Wednesday for 50 games following a positive test for testosterone.

The Padres improved to 4-8 against San Francisco this season and 10-20 over the last two years.

Vogelsong had his second straight sub-par outing. He gave up eight runs and nine hits in 2 2-3 innings in a 14-2 loss to Washington on Monday.

The right-hander lasted three-plus innings against San Diego and was charged with three runs and eight hits. Over his last two outings, his ERA has increased from an NL-best 2.27 to 2.85.

Will Venable hit a one-out single in the first, stole second and scored on Carlos Quentin's base hit. After Yonder Alonso singled and Alexi Amarista walked, Maybin drove in two more runs with a single.

The Giants countered with a run in the second after Buster Posey reached on Venable's two-base error when he dropped a routine fly ball to right. Posey went to third on a wild pitch and scored on Hunter Pence's sacrifice fly.

The Padres added three more in the fifth. Amarista hit a leadoff triple and scored on Maybin's single. Cabrera added a two-run double.

NOTES: Vogelsong's last two starts are his only outings this season that he did not pitch at least six innings. ... San Diego 3B Chase Headley was ejected before he took the field for the top of the fifth inning by home plate umpire Brian O'Nora. Headley flew out for the second out of the fourth and flung his bat down. But he never made it out of the dugout to take his position in the fifth. ... Quentin was hit by a pitch for the 14th time this season in the second inning to tie Philadelphia's Carlos Ruiz for the major league lead. Quentin has reached the total in nearly 100 fewer at-bats. ... The Giants are 7-0-3 in their last 10 series against San Diego. ... Pirates LHP Wandy Rodriguez (0-3, 5.47 ERA) will face Padres RHP Edinson Volquez (7-9, 4.31 ERA) on Monday night in San Diego.