Cahill (2-2) scattered six hits and allowed just one run over 7 1/3 innings to earn the win. It was easily the most impressive of the five starts he's made for Arizona since coming over from Oakland in an offseason trade.
"That's the best he's thrown for us," D-backs manager Kirk Gibson said. "Much more into the zone, commanding the zone early and often, and when you can do that, you can get early swings, and he got some early outs and kept his pitch count down."
Catcher Miguel Montero said he knew even before the game started that Cahill was going to have a good outing.
"I could tell when he was warming up," Montero said. "Because everything was working pretty good. His confidence level was way up when he saw himself working pretty good."
Harper was 0-for-3 against Cahill, and the veteran showed the rookie a thing or two when he struck him out in the second inning.
Cahill started Harper out with a pair of changeups for a 1-1 count and then threw a sinker that Harper swung through. And on the fourth pitch, Cahill went back to his changeup and Harper was way out in front and he swung and missed for strike three.
"I was throwing quite a few," Cahill said of his changeup. "I know he's got a quick bat, so I was just kind of hopefully having him speed it up and pulling the string on it a little bit."
Cahill struggled with his command in some of his earlier starts, but he was sharp Tuesday.
"In the past, it's taken him some time to get his rhythm and he's not been consistent in one spot," Gibson said. "Tonight, he was pretty much where he wanted to be all night."
Nats starter Jordan Zimmermann (1-2) matched Cahill through the first four innings before the D-backs took advantage of a defensive lapse to take a 1-0 lead in the fifth.
The D-backs increased the lead to 2-0 in the sixth and chased Zimmermann from the game with the bases loaded and one out in the seventh. Reliever Ryan Mattheus proceeded to hit Aaron Hill to force in a run, and Upton followed with a sacrifice fly for a 4-0 lead.
Upton's fly ball was fielded by Harper, who threw a strike on the fly to the plate, where McDonald just beat the tag.
"It was very impressive," Gibson said. "It kind of surprised me. We knew he had a solid arm, but very impressive throw."
Upton was caught off guard by the throw, as well.
"Obviously, it was an electric throw," Upton said. "I wasn't expecting it to be that close."
Cahill finally ran out of gas in the eighth, but Bryan Shaw was able to get the final two outs of the frame and David Hernandez retired the Nationals in order in the ninth to close things out.
"I feel like we have the hitters who can hit, but we are not as aggressive as I would like to see," said Nationals manager Davey Johnson. "Our one and two hitters [Ian Desmond and Stephen Lombardozzi] were aggressive. They swung the bat and got a couple of hits. But we are not centering on the ball. We are not getting a good strike and driving it. The talent is there."