"It was definitely nice to be back out there and contribute to a win," Hoskins said. "That was a pretty big series win for us."
J.T. Realmuto also went deep and Odubel Herrera was 4 for 5 with a home run and three RBI to help the second-place Phillies remain five games behind Atlanta in the NL East.
"It's a huge impact," Phillies manager Joe Girardi said about having Hoskins back. "My message to the club is just keep the line moving. ... Putting pressure on the other team is the important thing."
San Diego has lost nine of 11 and dropped a game behind Cincinnati in the race for the second NL wild card. The Reds beat Miami 3-1 to complete a four-game sweep.
It's the first time the Padres have been outside the playoff picture since April 21, when they were 10-10.
"Right now we are not playing the best version of our game," manager Jayce Tingler said. "We are going to continue to be upbeat and battle. ... Nobody is going to feel bad for us. You just have to continue to fight."
Hoskins, placed on the injured list Aug. 10 with a left groin strain, hit a solo shot to straightaway center field off reliever Ryan Weathers (4-6) in the fourth and and another long drive to left in the fifth against Miguel Diaz. Despite missing time, the first baseman leads the Phillies in home runs (26) and RBI (70).
"As the game went on I got more confident out there," Hoskins said. "We had a lot of different contributions today. You could kind of see that throughout the game - quality at-bats."
Gibson (9-5) gave up one run and six hits. He worked out of jams in each of the first three innings and then cruised for the next five.
"I felt really good in the first inning. J.T. and I were on the same page and we had a really good game plan," Gibson said. "It was a really fun day."
San Diego scored in the first. Trent Grisham doubled and went to third after holding up on a double to left field by Fernando Tatis Jr. Manny Machado drove in Grisham with a sacrifice fly.
"We were able to get a run there in the first and then we had a first-and-third scenario in the second inning and we felt pretty good. We weren't able to add on there," Tingler said. "As the game went on I thought Gibson kept making quality pitches. He kept working the edges on all quadrants."
Craig Stammen started a bullpen game for the Padres and threw two scoreless innings. Weathers had more trouble in the third, giving up a two-run single to Herrera.
"There is something about starting the game that is a little bit different. The last two have gone as planned - no runs given up," Stammen said. "We are disappointed in how the results have turned out the last seven to 10 days. We have to keep grinding it out."
Philadelphia tacked on three in the seventh for a 7-1 advantage. Herrera hit a solo homer off Diaz, followed by a walk to Bryce Harper and then a two-run drive by Realmuto.
Pinch-hitter Austin Nola had a three-run double in the ninth off Phillies reliever Hector Neris to narrow the gap to 7-4. Neris, however, struck out Grisham to end it.
Padres RHP Yu Darvish (lower back tightness) threw a bullpen, his second since exiting an Aug. 12 start. Darvish might return to the rotation this week against the Dodgers. He has a 1.35 ERA in three starts this season versus Los Angeles.
Phillies: LHP Ranger Suarez (5-4, 1.47 ERA) opens a two-game interleague series at home against AL East-leading Tampa Bay on Tuesday.
Padres: Had not announced a starter for the opener of a three-game home series against the Dodgers beginning Tuesday.
Hoskins homers in back-to-back innings as Phillies top Padres
Rhys Hoskins hits home runs of 426 and 395 feet as the Phillies beat the Padres 7-4.