Washington, DC – Jayson Werth belted a three-run homer to 1, in the opener of a four-game series.
Detwiler (2-3) allowed one run on six hits to earn the win. He walked one and struck out three.
Werth had a pair of hits and scored twice while Jonny Gomes knocked in a run for the Nationals, who have won five of seven.
Drew Storen worked a 1-2-3 ninth to record his 34th save of the season.
Joe Saunders (8-11) surrendered four runs on six hits and three walks over six innings to suffer the loss.
Henry Blanco hit a home run for the Diamondbacks, who saw their losing streak reach a season-high six games.