Marte homered on the first pitch of the game and added his 19th homer of the season leading off the fourth inning as Arizona took the first and third games of the four-game set.
Strasburg (7-4) allowed four homers in a game for the second time in his career, the first since August 8, 2014, at Atlanta. Strasburg, who had won four straight decisions, gave up a season-high nine hits and tied a season-high by allowing six earned runs.
"I think when you make mistakes here in the big leagues, you give them a chance to barrel it and they barreled it," Strasburg said.
Adam Jones also homered in the first inning, his 13th, to push Arizona's lead to 2-0.
"Getting that lead on Strasburg was pretty important, and then we gave it right back up," Arizona manager Torey Lovullo said.
"We've been very resilient and ready to fire when we've lost leads. Our guys did a great job, and they didn't shut down, and we got ahead of them the next inning."
Strasburg gave up three home runs in his first 21 pitches after allowing just two homers in his previous eight starts combined.
"Today was just one of those days," Nationals manager Dave Martinez said of Strasburg's tough outing. "Couldn't locate his fastball, just missing spots."
Yoshihisa Hirano (3-3) allowed two hits while striking out two in 1 2/3 innings as the Diamondbacks won for the eighth time in 10 games.
Nick Ahmed had an RBI double in the third that pushed the lead to 5-3. Ahmed also tripled in the second and singled in the eighth and the ninth, finishing with four hits.
"Marte set the tone from the first pitch," Ahmed said. "That's what we do: We go out and try to build big innings and make the pitcher work. We did that in a big way today."
Kevin Cron hit a pinch-hit homer in the eighth for Arizona.
Arizona starter Taylor Clarke, who grew up and went to high school in nearby Ashburn, Virginia, had 250 family and friends in attendance as he made his sixth start of the season. Clarke allowed three runs on seven hits while striking out six in 4 2/3 innings.
"It was tough taking him out of a game one out away from a victory, but that's just how it goes sometimes," Lovullo said.
Clarke tried to talk his manager into letting him face Soto a third time after the Nationals' left fielder had homered and singled off him earlier, but wasn't successful.
Strasburg allowed more than eight hits for the first time since August 17, 2016, at Colorado -- a span of 65 consecutive starts. It was the third-longest active streak in the majors behind Rich Hill (74) and Julio Teheran (66).
Diamondbacks: 3B Jake Lamb (strained left quad) homered on Friday for Triple-A Reno and is batting .250 with six RBI in five rehab games. "All things considered, we're really excited about how he's feeling," Arizona manager Torey Lovullo said. ... 2B Wilmer Flores (right foot contusion) will wait another week before beginning baseball activities after his most recent CT scan didn't show enough healing.
Nationals: Adams (back spasms) was back in the lineup for the first time since Monday. Adams had missed Washington's previous three games.
Diamondbacks: RHP Archie Bradley (2-3, 4.26 ERA) is set to make his first start since October 1 2016, in place of injured righty Luke Weaver. Bradley has appeared in 29 games out of the bullpen this season.
Nationals: RHP Anibal Sanchez (2-6, 3.92 ERA) will take the mound Sunday looking for his 100th career win. Since coming off the injured list on May 29, Sanchez is 2-0 with a 1.04 ERA in three starts.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
Tigers, Indians put on a HR barrage
The Tigers and Indians put on a show with a combined seven home runs as Cleveland holds on to win 8-6.
Giants hit back-to-back homers in win vs. Rockies
Stephen Vogt and Brandon Crawford hit back-to-back homers in the fourth inning as the Giants beat the Rockies 2-1.
Mikolas, O'Neill lead Cardinals to 7-0 win over Pirates 7-0
Miles Mikolas pitched an eight-hitter and Tyler O'Neill hit a pair of two-run homers, leading the St. Louis Cardinals to a 7-0 win over the Pittsburgh Pirates on Monday night.
Freeman, Fried power scorching hot Braves past Brewers, 4-2
Freddie Freeman hit his 25th home run of the season, Max Fried pitched five scoreless innings and the Atlanta Braves' relievers hung on for a 4-2 victory against the Milwaukee Brewers on Monday night.
Schwarber crushes game-tying homer
Kyle Schwarber hits a ball to deep-left center for a solo shot to tie the game in the bottom of the third inning.
Wind carries Puig's fly ball for a HR
Yasiel Puig lifts a high fly ball into left field and gets a little help from the wind as the ball carries into the netting for a home run.