WASHINGTON -- For the second night in a row, a catcher had a big hit late in the game to help his team win at Nationals Park.
On Tuesday, Washington backstop Wilson Ramos hit a two-run single in the eighth inning to break a 3-3 tie, and the Nationals won 5-4.
Castillo finished 2-for-4 with a walk and his 13th homer Wednesday. He has six homers in his past eight games.
"I don't know how to explain what's going on right now," he said. "Just go there, see the ball, hit the ball, just try to keep everything simple and not think about anything. I really feel good. The more important thing is this team gives me the opportunity to be out there every day and have a chance to get better every time."
"He is very hot right now," winning pitcher Rubby De La Rosa said of Castillo.
Arizona manager Chip Hale added, "It is great for us. ... He is a strong guy."
Diamondbacks third baseman Aaron Hill had a sacrifice fly in the third inning and a bases-loaded walk in a four-run sixth. He also made a fabulous diving catch to rob Nationals catcher Jose Lobaton of a double in the fourth before Arizona staged its comeback.
Center fielder A.J. Pollock, left fielder Ender Inciarte and first baseman Paul Goldschmidt each had three hits at the top of the Arizona lineup.
"Better at-bats. I think Goldy felt good (after striking out four times Wednesday)," Hale said.
Arizona (52-54) won for the eighth time in 11 games, and Washington (55-51) lost for the fifth time in six outings. The Nationals are two games behind the National League East-leading New York Mets, who won in Miami for their sixth victory in a row.
Washington allowed the most runs in a home game this year. So will the lopsided loss light a fire under the team?
"I think we will have a conversation tomorrow," Nationals manager Matt Williams said. "We have lots of games left."
Will the embarrassing setback, which featured first baseman Tyler Moore pitching in the ninth, galvanize a team that was a World Series favorite?
"I hope so," said the solemn Williams.
Said Washington right fielder Bryce Harper: "We've just got to keep battling, keep grinding, and we'll come in and every single day you've got a new slate. Just got to keep smiling, keep laughing and try to have some fun. We've got a long ways to go. I'm all fine, fine and dandy."
The Diamondbacks, who finished with 17 hits and scored 10 runs in the last four innings, took the lead with four runs in the sixth.
Right fielder Yasmany Tomas and second baseman Chris Owings scored when Washington reliever Aaron Barrett (3-3) made a throwing error on a bunt single by Diamondbacks shortstop Nick Ahmed, giving Arizona a 3-2 lead.
Pinch hitter Jarrod Saltalamacchia, batting for De La Rosa (9-5), singled to drive in Ahmed and give the visitors a 4-2 advantage. Hill drew his bases-loaded walk off reliever Tanner Roark to extend the margin.
Castillo crushed a three-run homer in the eighth off Matt Thornton to give Arizona an 8-2 advantage. The Diamondbacks made it 9-2 in the ninth on a balk by Felipe Rivero.
Pollock singled in a run to make it 10-2 in the ninth, and that brought in Moore to pitch in a mop-up role. Goldschmidt drove in a run with a fielder's choice to make it 11-2.
Washington center fielder Michael A. Taylor hit a two-run homer in the bottom of the ninth.
De La Rosa allowed two hits and two runs with three strikeouts and three walks in five innings, but he labored, throwing 101 pitches.
Nationals starter Gio Gonzalez, who did not factor in the decision, gave up eight hits and one walk but just two runs in five innings. He threw 95 pitches.
"He will be ready for the next time," Williams said of Gonzalez, who has still not lost at home since June 4.
Said Gonzalez: "Right now, I've just got to focus on my job, and that's go out there and pitch more than five innings."
The Arizona starter also pitched five innings but got the win.
"I tried to put my emotions down," De La Rosa said, referring to a rough first inning. "They tried to jump on me (and the four-seam fastball). Then I had to switch my game plan."
NOTES: RHP Zack Godley, who is 3-0 with a 1.50 ERA through his first three major league starts, was optioned to Double-A Mobile, and the Diamondbacks called up RHP Allen Webster from Triple-A Reno. Chief baseball officer Tony La Russa said that the team does not plan to go with a six-man rotation and wanted more help in the bullpen after LHP Patrick Corbin lasted just 1 1/3 innings Tuesday. ... The four-game series ends Thursday afternoon with Arizona RHP Jeremy Hellickson (7-7, 4.95 ERA) facing Washington rookie RHP Joe Ross (2-3, 3.00). ... Nationals RHP Stephen Strasburg, on the disabled list since July 5 with a left oblique strain, threw a bullpen session Wednesday after he making a rehab start Monday for Triple-A Syracuse. He could start for Washington this weekend at home against the Colorado Rockies.