Anderson won his first five big league starts this year, but then dropped his next four before Monday.
"Much better command," D-backs manager Kirk Gibson said. "Good in counts that he needed to be in and made pitches."
The D-backs provided him with plenty of offensive support as they sent nine men to the plate while scoring five runs in the second inning.
"The run support, obviously that's always nice to have because you can relax a little bit," Anderson said.
Martin Prado started the frame with a homer -- his first since June 14 -- while David Peralta and Miguel Montero each added two-run doubles to cap it.
"That was a good swing, kind of got it going," D-backs first baseman Paul Goldschmidt said of Prado's homer. "But there was just a ton of hits there and guys had a lot of good at-bats."
The runs came off Marlins starter Tom Koehler (6-7), who was removed after the first two batters reached base in the fourth.
"He just didn't have it," Marlins manager Mike Redmond said. "His command was off, had a tough time throwing his fastball for strikes. And he left some pitches right out over the plate, and they hammered them. That's pretty much it. Not a whole lot you can say."
The D-backs scored three runs in the fourth, including another RBI from Peralta, who finished with three.
"It feels good," Peralta said. "I've been working hard every day trying to do my thing, trying to do the right things. It's going well right now."
Indeed, in 32 games since coming up from Triple-A Reno, Peralta has hit .331 with an on-base percentage of .357.
"It's been unbelievable," Goldschmidt said of Peralta. "He came up right off the bat and he had that hitting streak to start it. He just has put together good at-bats every time. I would say really, really, really impressed. He's been doing unbelievable. Not just hitting, but he plays good defense out there."
Just two years ago, Peralta was a struggling pitching prospect before being converted to the outfield.
"I'm just living the dream right now," Peralta said. "It's been fun. I'm having fun every day playing my game. I'm just happy to play the game and keep focused on what I'm doing every day."
Anderson (6-4) allowed one run on seven hits and a pair of walks while striking out eight -- including three of All-Star slugger Giancarlo Stanton.
"He's a big guy up there," Anderson said. "You've got make good pitches to him. I kind of got a little deep in the one count to him, 3-2, but I threw a changeup. It's my best pitch, and I just thought if you're going to hit it, you're going to hit it, if you're going to miss it, you're going to miss it. So I'm glad he missed it."
The lone run against Anderson came in the sixth when Adeiny Hechavarria's sac fly scored Casey McGehee. Anderson did a nice job of limiting the damage that inning as the Marlins had the bases loaded with just one out.
The Marlins were 0-for-10 with runners in scoring position and left 10 men on base.
"I just had fastball command from the get-go," Anderson said. "And if you have that as a starting pitcher, you're going to be more successful because you can throw the other pitches off that."