The Mets have won five straight in Philadelphia and seven of eight overall this season.
Harvey (3-3) allowed two runs and six hits, striking out six in 6 1-3 innings. He also had an RBI single. The rookie has a 2.76 ERA in seven starts.
Tyler Cloyd (0-1) was decent in his major league debut filling in for Cole Hamels, who was scratched from the start because of a gastrointestinal illness.
Cloyd allowed three runs and seven hits in six innings. The 25-year-old righty was 15-1 with a 2.26 ERA in the minors this season, including 12-1 with a 2.35 ERA at Triple-A Lehigh Valley.
Josh Edgin, Robert Carson and Jon Rauch combined to get five outs before Frank Francisco finished for his 22nd save in 25 tries.
Both teams are tied for third place in the NL East. They trail St. Louis by 10 games for the second wild-card spot with 32 games remaining, making it unlikely they'll be playing in the postseason.
The lead went back-and-forth over the first three innings until Duda put the Mets up to stay with his 13th homer and first since being recalled from the minors on Sunday. His last homer came on July 6 before he was sent down later that month.
After Jimmy Rollins hit an RBI double to put Philadelphia up 2-1 in the second, Duda ripped a line-drive out to right to give the Mets a 3-2 lead in the third.
Duda preserved the one-run lead with a running catch on Ryan Howard's liner to deep left with two on and two outs in the fifth.
Harvey helped himself in the second with a hit. Scott Hairston led off with a double and scored on Harvey's one-out single to left to tie it at 1.
Harvey is 6 for 13 with two doubles and three RBIs.
The Phillies went up 1-0 in the first on Howard's sacrifice fly. Juan Pierre lined a single off the right-field fence, advanced to third on Chase Utley's single and scored on Howard's fly.
Notes: The Mets have won seven games in Philadelphia in a season for the first time since 1972 when they went 8-1 at old Veterans Stadium. ... Utley caused a stir before the game when he took grounders at 3B. He hasn't played there in 10 years, but is considering trying it out to give the Phillies flexibility for next year. ... Phillies OF Domonic Brown wasn't in the lineup for the third time in four games because of a troublesome knee. ... The Phillies placed RHP Vance Worley on the disabled list and announced he'll have elbow surgery next month. ... Cloyd drew a walk in his first two plate appearances. ... Duda has hit just four of his 13 homers away from spacious Citi Field. ... Harvey is likely to make about three more starts before he reaches an innings limit set for him in his second professional season. ... Kyle Kendrick (7-9, 4.12) faces Jonathon Niese (10-7) in the series finale Thursday afternoon.