Updated

Philadelphia, PA (SportsNetwork.com) - Ryan Howard hit a two-run home run and Roberto Hernandez pitched seven strong innings as the Philadelphia Phillies beat the Arizona Diamondbacks, 4-2, in the rubber match of a three-game series.

Howard broke a 2-2 tie by scoring on a controversial play in the sixth. Marlon Byrd hit a high pop-up into shallow right field that would've ended the inning, but second baseman Didi Gregorius dropped the ball. The throw home beat Howard, but a review ruled that catcher Miguel Montero blocked the plate and the Phillies were awarded the run.

"This year, that's a run," Phillies manager Ryne Sandberg said. "In the last 100 years, that's not."

Ben Revere had an RBI double for the Phillies, who won their first home series since sweeping the San Diego Padres in a three-game set in June.

Hernandez (5-8) only allowed two runs on four hits while not surrendering a walk.

Paul Goldschmidt and Nick Ahmed each had one RBI for the Diamondbacks, who haven't won a series against the Phillies since April of 2011.

Vidal Nuno (0-2), who was looking for his first win since being traded to Arizona from the Yankees on July 6, allowed four runs -- three earned -- and four hits while striking out five.

Howard wasted no time putting the Phillies on the board. With two away in the first, Chase Utley walked and Howard smacked one into the seats in left center to give the Phillies an early two-run lead.

"He got us, but nevertheless, it's the first inning," Diamondbacks manager Kirk Gibson said. "You've got a chance to make that up and we didn't do it."

The Diamondbacks cut the lead in half in the second as Ahmed doubled down the line in right to score Gerardo Parra.

After three scoreless innings, Arizona tied the game in the sixth. Ender Inciarte led off with a double and a ground out by David Peralta moved him over to third. Goldschmidt hit a sacrifice fly to the warning track in right field, plating Inciarte.

Philadelphia took the lead back a half inning later. After Howard reached first on a walk, Byrd's pop-up, Gregorius's error and the overturned out at home call allowed Howard to score.

The Phillies stretched the lead to 4-2 in the seventh. After a single by Wil Nieves, Revere hit a two-out fly ball that tipped off the glove of Peralta in left. Montero couldn't handle the throw to the plate and Nieves scored.

Jonathan Papelbon induced a double play with two men on base in the ninth to end the game and secure his 25th save of the season.

Game Notes

The Phillies are 16-5 in their last 21 home games against the Diamondbacks ... Prior to the game, Howard hadn't homered since June 1 ... Phillies reliever Ken Giles pitched a scoreless eighth inning. Fifteen of his 17 major league appearances have been scoreless and he owns an ERA of 0.98 in his first season in the MLB ... Gibson needs two wins to tie Bob Melvin for the most wins in club history ... Diamondbacks first base coach Dave McKay missed the game to attend the Hall of Fame induction ceremony. He was replaced by Henry Blanco.