PHOENIX (AP) Cameron Rupp homered and drove in a career-high four runs Wednesday, and the Philadelphia Phillies avoided a series sweep with a 7-6 win over the Arizona Diamondbacks.

Rupp capped a four-run sixth with a three-run shot off Arizona reliever Keith Hessler, who did not allow a batter to reach base in his two previous outings. Rupp's homer broke a 4-all tie.

Rupp drove in another run with a sacrifice fly. Cody Asche scored on Rupp's double-play grounder - not an RBI - in the fourth inning.

More from FoxSports

Phillies rookie Aaron Nola pitched five innings for the win. Nola (3-1) allowed four runs and nine hits for his third win in four starts.

The Phillies bullpen almost gave back the lead. Arizona scored once in both the seventh and eighth innings before Ken Giles got the last out in the eighth and three in the ninth for his seventh save.

Giles struck out Paul Goldschmidt with runners at the corners to end the eighth and fanned Jamie Romak with a man on to end the game.

Goldschmidt had three hits and two RBIs for the Diamondbacks.

In the sixth, Ryan Howard doubled and Jeff Francoeur reached base with a single. Freddy Galvis had a one-out RBI single, then Rupp hit a drive that landed in the right field seats.

The Diamondbacks cut the lead to two on Wellington Castillo's sacrifice fly. They made it 7-6 in the eighth on Chris Owings' RBI double, but Owings was thrown out at home plate on a grounder to second base.

Diamondbacks manager Chip Hale had lost his challenge earlier in the game, but the umpiring crew went to replay for the play at the plate and upheld the call after a four-minute review.

Chase Anderson (5-5) allowed five runs on nine hits. He struck out five and walked one.

TRAINER'S ROOM

Phillies: 3B Maikel Franco was out of the lineup because of a left wrist contusion. He was hit by a pitch Tuesday night.

Diamondbacks: OF Yasmany Tomas (calf tightness) and OF David Peralta (quadriceps tightness) were held out of the starting lineup on Wednesday, but both are expected to be able to play Friday after a Diamondbacks' off day Thursday, manager Chip Hale said. Peralta pinch hit in the ninth and singled. Both players were removed during Tuesday night's game. .. Reliever Randall Delgado was scheduled to pitch in a summer league game in nearby Scottsdale on Wednesday night, and the plan is to send him to Double-A Mobile to pitch this week as he comes back from a sprained ankle. ... P Archie Bradley threw Wednesday morning, working his way back from right shoulder tendinitis. ... C Gerald Laird (back) caught five innings in a rehab assignment at Triple-A Reno Tuesday night.

UP NEXT

Phillies: After a day off, the Phillies have rookie LHP Adam Morgan scheduled to start Friday at Milwaukee. Morgan is 3-3 with a 4.06 ERA in eight starts this season and has won two of his last three outing.

Diamondbacks: It's LHP Robbie Ray on the mound for the Diamondbacks Friday in Atlanta after Thursday's off day. Ray has thrown six innings or more eight starts this season. He has never faced the Braves.