Gonzalez (6-3) allowed three runs and was lifted with two outs in the seventh in favor of Craig Stammen, who gave up a three-run homer to Carlos Quentin to make the score 8-5 before getting out of the inning.

Ramos had RBI singles in the second and the third after he had five RBIs Thursday in his return from the disabled list with a hamstring injury. Jayson Werth had three hits and has reached base in seven of his last eight at bats after dropping to the No. 6 spot in the order from the No. 2 hole.

Tyler Clippard and Rafael Soriano (23rd save) got the last six outs for the Nationals (44-42), who have not been three games over .500 since May 18. San Diego (40-47) lost its seventh straight as starting pitcher Andrew Cashner (5-4) took the loss.

Gonzalez is now 8-1 against the NL West in two seasons with Washington.

Washington already led 6-2 before Adam LaRoche had an RBI single and Werth had an RBI groundout in the fourth to give the Nationals an 8-2 advantage.

Ramos, who came off the disabled list Thursday, had an RBI single in the third to give Washington a 6-2 lead.

The Nationals scored five runs in the second to make it 5-1 against Cashner, who entered with a 3.31 ERA.

Ramos had a two-run single to left, Denard Span smashed a two-run double into the right-field corner, and Bryce Harper hit a long sacrifice fly to center with the bases loaded.

San Diego had taken a 1-0 lead in the first on an RBI double by Chase Headley against Gonzalez. Headley made it 5-2 with a solo homer to left in the third.

Cashner yielded six runs and was taken out with two on and no outs in the third. He was replaced by Tim Stauffer, who gave up the two runs in the fourth.

NOTES: SS Everth Cabrera was activated from the 15-day disabled list and was in the starting lineup as the leadoff hitter. "I am really excited to be back," said Cabrera, who leads the National League with 31 steals. To make room, RHP Burch Smith was sent to Triple-A Tucson. ... RHP Stauffer, a star at the University of Richmond, will have several family members in for the weekend series. He said he plans to leave 10 tickets for the Saturday game. His grandparents live in Annapolis, Md., and he visited them before the game. ... Washington C Ramos had five RBIs, including a three-run homer, in an 8-5 win Thursday over the Brewers. According to Elias Sports Bureau, he is the first person to get five RBIs in his first game back after seven-plus weeks on the DL since Nelson Cruz in 2007 ... RHP Ryan Mattheus threw off the mound for the first time since going on the DL on May 22 with a hand injury, according to Washington manager Davey Johnson ... Every Washington starter but Harper got on base by the end of the fourth.