(TSX / STATS) -- PHILADELPHIA -- Arizona Diamondbacks manager Torey Lovullo admitted Rey Fuentes was one of the last players he expected to win a game for his team the way he did.

Fuentes picked an opportune time to hit his first career home run, hitting a tiebreaking homer to dead center field in the top of the 10th inning to help the Diamondbacks complete a 5-4, come-from-behind win over the Philadelphia Phillies on Sunday.

The Diamondbacks (44-26), completing a sweep of the Phillies (22-46), won their seventh straight. They're finding all different ways to do so.

Trailing 4-3 entering the ninth, Arizona took advantage of Philadelphia closer Hector Neris, who had trouble locating his pitches. He walked Nick Ahmed to start the inning before giving up a single to David Peralta that allowed Ahmed to advance to third. Gregor Blanco followed Peralta with a single of his own to score Ahmed and knot the score at 4.

"His split is hot and cold," Phillies manager Pete Mackanin said of Neris. "For every two good ones he throws, he throws two bad ones. It's hard to figure out what he's doing. He walked that leadoff hitter and that's the guy that scored. He's tough to figure out."

The ninth-inning comeback set up for Fuentes' heroics. Phillies reliever Jeanmar Gomez (3-2) was tasked with pitching the 10th. After getting a groundout to start the inning, Gomez left a changeup elevated and Fuentes hit his first home run in his 150th career plate appearance.

"They were resilient," Lovullo said. "We had a couple tough moments today and these guys didn't let that affect them. I said from the beginning, overcoming tough moments, cycling it through and then coming out the other end is something that winning teams do, and we do that very well. We didn't feel like we were out of the game at any point today."

"We expect to win," Fuentes said.

Archie Bradley (3-1) picked up the win after working out of trouble in the bottom of the ninth. Fernando Rodney picked up his 20th save.

The Phillies took the lead in the sixth when pinch-hitter Ty Kelly smashed a go-ahead double to break a 3-3 tie and give the Phillies a 4-3 lead. Initially, the double scored two, but the Diamondbacks challenged the call and shortstop Freddy Galvis was ruled out at home plate.

Pat Neshek and Joaquin Benoit protected the one-run lead in the seventh and eighth, respectively, before Neris stumbled.

Phillies starter Ben Lively became the first Phillies pitcher since 2001 to start his career with four consecutive quality starts.

Lively struggled early. He allowed three runs in the first inning on two home runs, one by Paul Goldschmidt and one off the bat of Micah Owings. But he settled down, allowing just the three runs and eight hits. He walked one and struck out six.

Arizona's Robbie Ray wasn't at his best. He allowed four runs and eight hits in 5 1/3 innings. He walked four and struck out seven. Ray entered Sunday having gone 5-0 in his last five starts, allowing just one run in 37 innings. But the Phillies solved him early and scored a run in each of the first three innings.

"I think there might have been a little overall fatigue," Lovullo said. "He was exerting a lot of energy early. It was very hot and humid out there. He had an at-bat where he had to run the bases. I just think he got a little winded and tired."

Aaron Altherr and Maikel Franco hit solo home runs in the first and second innings, respectively. The Phillies tied the score at 3 in the third on an Altherr groundout into a double play.

While the Phillies were chipping away at Ray, Lively settled in. After the three-run first inning in which he threw 33 pitches, Lively surrendered just four hits in his next five innings, striking out five in the process. He entered the game with just five strikeouts this year.

His outing, however, was wasted.

"We couldn't hold the lead," Mackanin said. "We're not putting up enough crooked numbers. We had opportunities to win that game."

NOTES: Phillies 1B Tommy Joseph extended his hitting streak to 14 games, the longest active streak in the majors, with a single in the fifth inning. ... Arizona OF A.J. Pollock (strained right groin) played five innings Saturday night in a rehab start at Triple-A Reno. He was 1-for-2 with a double and a walk. Pollock has been on the disabled list since May 15. ... Both teams have an off day Monday. ... The Phillies play host to St. Louis in a three-game series starting Tuesday. The Diamondbacks head to Colorado for a showdown of National League West powers. ... The Phillies and Diamondbacks meet again next weekend in Arizona.