SAN DIEGO — Rhys Hoskins, playing for the first time in more than two weeks, walked Sunday afternoon through the visiting dugout at Petco Park with a pair of straw hats sitting atop his head. The Phillies had struggled to hit for power while Hoskins was on the injured list and his absence became more glaring with each game he missed. Their offense was missing a punch.

So consider it a welcome sight to see Hoskins wearing two of the team’s homer hats in the fifth inning of a 7-4 win over the Padres. Hoskins wasted little time making his presence felt as he homered in two of his first three at-bats and sparked the team’s offense as they responded after Saturday’s brutal loss. The Phillies hit four homers, which equaled the amount they hit in the previous four games.

“In this stretch run, we’re going to be playing some more pressure-packed games and we now have a healthy lineup,” Hoskins said. “We’re not relying on one or two guys every night. I think that’s what makes the lineup deep.”

While Hoskins was on the injured list, the Phillies had the second-worst slugging percentage in the National League and hit the ninth fewest homers in the majors. Their meager offense was the primary reason the Phils dropped from first place to five games out in one week.

“My message to the club is to just keep the line moving,” manager Joe Girardi said. “Don’t get caught up in trying to hit home runs. Keep the line moving. But obviously when you can hit two-run home runs and can pick up quick runs, they help. To me, getting on base and keeping the line moving and putting pressure on the other team is the most important thing.”

Sunday was just one game against a cast of relief pitchers, but it was easy to see how much better the lineup is when Hoskins is in it.

“We’ve missed him,” general manager Sam Fuld said before the game. “He just changes our lineup. He stretches our lineup and he’s a big part of what we do. A lot of times, he carries this offense and we’re just excited to get him out there and see what he can do for us.”

“Rhys is a stud,” pitcher Kyle Gibson said. “Rhys is a guy we need in the lineup. Not only his power presence but the way he sees pitches and works at-bats. He’s a guy who gives pitchers problems because he has so many weapons up there.”

» READ MORE: Phillies send Alec Bohm to the minor leagues after he failed to match last season’s rookie success

The Phillies won two of three against the Padres yet lost ground in the division as the first-place Braves swept Baltimore and have won nine-straight games. The Phils trail the Braves by five games but the next two weeks present an opportunity to make a move.

“We’re a really good team,” Gibson said. “We know it and we believe it.”

The Phillies play 10 of their next 12 games against the Diamondbacks, Nationals, and Marlins while the Braves play their next seven games against the Yankees, Giants, and Dodgers before four games at the Rockies, who have been tough this season at home. The Phillies have not done a good job this season of cleaning up against bad teams, but they’ll have to do so in order to get to October.

“It’s going to be as competitive as can be,” Hoskins said. “We understand where we’re at and understand that the teams ahead of us are also pretty competitive teams. At the end of the day, I think if we take care of business we’ll probably find ourselves where we want to be at the end of the year.”

Gibson deals

Gibson pitched eight strong innings, continuing to prove to be a strong addition at last month’s trade deadline. The right-hander allowed just one run on six hits while striking out three and walking one. He has a 2.36 ERA in four starts since joining the Phillies.

“That’s probably the most locked in I’ve felt since a couple starts before the All-Star break,” Gibson said. “Fixing my eyes and fixing a little bit of the delivery stuff allowed me to use that glove-side fastball a little bit better, command it a lot better, and even command my changeup a lot better. When I’m able to do that, I feel pretty good about how I can navigate a lineup.”

He was an All-Star this season in Texas by finding success as one of the American League’s best ground ball pitchers and that has carried over to the NL. Gibson induced plenty of weak contact on Sunday as he recorded half of his 24 outs on the ground.

“He’s been great,” Girardi said. “He’s throwing the ball extremely well. ... He’s a complete pitcher. He holds runners, he fields his position, and he’s been able to handle the bat. It’s been great having him.”

Herrera’s rolling

Odúbel Herrera kept his strong August going with a two-run single in the fourth and a homer in the seventh. J.T. Realmuto also homered in the seventh. Herrera went 4-for-5 and his single put the Phillies ahead by two runs after Hoskins tied the game with his first homer.

“I just think he’s a little bit healthier than he was, maybe,” Girardi said. “The Achilles bothered him and the ankle. We still have to guard against that and those are things we have to monitor. Odúbel hasn’t played a lot in the last couple years so I think managing that is important.”

Herrera is hitting .368 this month with a 1.141 OPS after batting .212 in June and July with a .611 OPS. He started Sunday in left field for Andrew McCutchen, who struck out five times Saturday night and has just four hits in 39 at-bats since returning from the injured list.

“It’s huge, especially out of the leadoff spot,” Hoskins said of Herrera. “We’ve had a little bit of a revolving door at the top of the lineup whether it be injuries or people just not seeing the ball well. To have someone who can pop you at any time and is a bit of a wild card in the box, makes it tough for pitchers to game plan. Leading off a game, that’s tough. It’s nice to see him get on base the way he did today.”