It was the Royals' 11th victory in the last 14 games, putting them just 3 ½ games behind first-place Detroit in the American League Central. And they're just a half-game behind Toronto for the second Wild Card spot.
The Royals previously won series over Chicago, Cleveland, Minnesota and Oakland.
To cap off the evening, the Royals' Ned Yost marked the 800th victory of his managerial career at Milwaukee and Kansas City. Yost, though, wasn't concerned with that aspect of the victory.
"This was a big win for us. Detroit lost and this puts us at 3½," he said. "Every game is huge. There's no difference than in April or May. There are no giveaway games. We won the division one year in Atlanta with 105 wins and the Giants had 104. Where did that game come from? It didn't come in September. It could've come in April or it could've come in May. Every game is huge, every play is huge."
In this game, no play was bigger than the one that got the Royals' their fourth run and a 4-2 cushion going into the last of the ninth inning.
Moustakas got his fourth RBI thanks to a instant replay challenge in the top of the ninth. Billy Butler, who doubled and went to third on a fly out, scored as a result of the overturned ruling.
Originally, Alex Gordon was out at second base and Moustakas also was declared out at first base for an inning-ending double play. But Yost challenged the call and Moustakas was safe and the fourth run was home.
"We win the game by one so obviously it was huge," Yost said. "I got a really good look at it, so instant replay helped us get that fourth run. It was big."
Moustakas warmed up by lining a two-run homer over the right-field wall in the second inning against D-backs starter Josh Collmenter. His team-high 14th blast came after Lorenzo Cain's two-out single.
In the fourth, Gordon and Cain both walked with two outs and Moustakas drilled a single to right field, scoring Gordon.
Royals starter Yordano Ventura got his ninth victory despite not having his best stuff. In six innings, he held the D-backs to two runs despite their eight hits.
"They were really swinging the bats well against Ventura," Yost said. "Ventura really kind of had to grind it out tonight. He couldn't get his secondary stuff going on a consistent basis. They were sitting dead-red fastball and putting good swings on it. But he made big pitches when he had to."
Once Ventura was out of the game, the Royals' bullpen plan unfolded successfully. Kelvin Herrera pitched a scoreless seventh. Ditto for Wade Davis in the eighth although he had to pitch past two singles.
And, thanks to the instant replay run in the ninth, closer Greg Holland could afford to give up a run on two singles and a sacrifice fly. With the tying run on base, he struck out pinch-hitter Andy Marte to notch his 32nd save.
When the D-backs' Cliff Pennington looked at Ventura followed by the three relievers, he saw a succession of pitches hitting in the high 90s and up to 100-plus mph.
"You look at the ones they were throwing against -- us there's a reason those guys are good. I mean, that's about as good of arms as we've seen all year," said Pennington, who just off the disabled list. "I know I haven't played in a while, but 98-101 over and over and over again is pretty good."
Yost deflected the attention from his 800th victory.
"It's nice, but I didn't win any of those 800 games -- those guys and a lot of guys like them won every one of those 800 games," he said. "You keep it in perspective. You just keep winning."
That's what "those guys" in the clubhouse have in mind. They're starting to smell the heady aroma of the team's first playoff berth since 1985.
"Absolutely, that's where we want to be," Moustakas said. "That's what we've worked our whole offseason, our whole year to get to -- those playoffs."