Willingham had three of the Nationals' 11 hits in their sixth straight win, and his two-run single snapped a 5-5 tie with two outs in the bottom of the seventh.
Ryan Zimmerman's solo homer created the tie earlier in the seventh.
Elijah Dukes had three RBI, Wil Nieves one, while Christian Guzman added three hits for the Nationals, who have won three of four against the Diamondbacks this season.
Jason Bergmann (2-1) got the win, and closer Mike MacDougal picked up his 11th save.
Arizona's Mark Reynolds hit his 34th homer, a solo shot.
Stephen Drew had four RBI, including a three-run homer.
Reynolds had three hits, while Gerardo Parra and Augie Ojeda had two hits each for the Diamondbacks, whose five-game winning streak ended.
The losing pitcher was Juan Gutierrez (3-3).