Jesus Guzman hit a three-run homer and the San Diego Padres held off the Arizona Diamondbacks, 6-5, to avoid a three-game sweep.
Logan Forsythe, Chris Denorfia and Chase Headley added an RBI apiece for the Padres, who had 11 hits.
Clayton Richard (14-12) gave up four runs on eight hits over six innings to win his fifth consecutive decision. He is a brilliant 6-0 lifetime versus the Diamondbacks.
Adam Eaton and Aaron Hill hit solo homers for Arizona, which sits 5 1/2 games behind St. Louis for the second wild card berth in the National League. The Cardinals beat the Astros on Thursday.
Tyler Skaggs (1-3) allowed four runs on seven hits over five innings. He walked three and struck out two.
The Padres put a three-spot on the board in the first inning. With two outs, Headley walked and Yasmani Grandal singled. Guzman followed with a homer to left field to make it 3-0.
"He (Skaggs) gets an 0-2 count on Guzman. He tries to waste a fastball, throws it right where he doesn't want it. That is a live and learn deal," D'backs manager Kirk Gibson said.
Hill's solo homer to left in the bottom half cut the gap to two.
San Diego tacked on another run in the second. Richard reached base on a fielder's choice and raced home on Forsythe's double to left-center field.
But Arizona got the run back in the fourth after Justin Upton doubled and scored on Chris Johnson's two-out single.
Each team scored a pair of runs in the sixth. Andy Parrino got the top half started with a single, moved to second on a sacrifice bunt and crossed the plate on Denorfia's double to right. Headley's RBI double to left field gave San Diego a 6-2 lead.
Upton hit a one-out triple in the bottom half and scored on Paul Goldschmidt's single. Goldschmidt advanced to second on a wild pitch and raced home on Johnson's single to left, making it a 6-4 contest.
Eaton's first career homer in the seventh cut the gap to one.
Arizona had a golden opportunity to win the game in the ninth. Johnson singled to left, pinch-hitter Ryan Wheeler reached base on second baseman Forsythe's error and pinch-hitter Jason Kubel walked to load the bases with no outs. But the home team failed to capitalize. Pinch-hitter Mike Jacobs popped out, Eaton grounded into a fielder's choice and Hill struck out swinging.
"This is one of those where if you would have told us or the Diamondbacks that it would come down to five pitchers in the ninth (inning) and in a one-run game and still end up winning you would say you were crazy, but baseball is a funny game that way," Padres manager Bud Black said.
San Diego went 11-7 against Arizona this season ... Anthony Bass, who was the fifth San Diego pitcher in the ninth, recorded the final out to pick up his first save in the big leagues.