McCarthy (1-3) earned his first win of the season in his ninth start after firing eight shutout frames in his previous outing -- a no-decision against the Phillies.
The right-hander allowed two walks and struck out five in the 100-pitch gem.
Gerardo Parra homered on the first pitch of the game to provide the only run for the D-backs, who reeled off a fourth straight win.
The Marlins' Tom Koehler (0-2) absorbed the hard-luck loss, surrendering one run on three hits over six innings.
Millions of Getty images now available for free via embed tool
Ray Liotta sues skin care company over use of likeness