MIAMI -- Harold Ramirez committed an ugly error and disagreed with a ruling that cost him an RBI double. Even so, the rookie outfielder had one of his best games yet.
"I really feel so good about my day today," Ramirez said. "I enjoyed everything I do. I made an error, but that happens sometimes."
Arizona's lone run scored in the second inning when Ramirez fielded a single and made a wild throw from left field, allowing Nick Ahmed to score from first.
Miami went ahead to stay in the fifth when Ramirez's two-out liner deflected off the glove of left fielder David Peralta, allowing Miguel Rojas to score from first. The official scorer charged Peralta with an error.
"I think that one is a base hit for me, a double," Ramirez said.
"The ball was hit hard, I know that," Marlins manager Don Mattingly said.
Diamondbacks left-hander Robbie Ray (9-7) allowed two earned runs in six innings. He said he hasn't been affected by speculation he might be traded.
"I'm going out there to pitch every fifth day, so whatever happens happens," Ray said. "I feel like I've put myself in a good situation. I've been pitching really well lately, so we'll just have to see."
Ray's streak of wins in four consecutive starts ended even though he struck out 11 and walked none.
Rojas led off the first inning with a home run for the second game in a row. Miami teammate Brian Anderson added his 14th homer in the sixth, and Ramirez hit a two-run shot in the seventh, his sixth.
"That was unbelievable, and a great turning point in the game," Rojas said.
Arizona totaled four hits against five pitchers.
"I don't want to disrespect any major league pitching staff," Diamondbacks manager Tony Lovullo said, "but I know that we've got a better offensive team than we showed today."
Arizona went 0 for 7 with runners in scoring position.
"We got some big outs out of the `pen," Mattingly said.
Ramirez had two hits to hike his batting average to .276 in 63 games. The error was his first, but his defense has been inconsistent.
"Harold is a guy who is still making adjustments up here," Mattingly said. "He made some nice plays today; I also saw him just about throw one in our dugout. He's a work in progress. It will work its way out what kind of player he's going to be."
Diamondbacks RHP Greg Holland lost his job as closer after blowing a save for the fifth time in 22 chances this season in Friday's loss. Lovullo said he'll go with a closer by committee temporarily to give Holland a breather for a while. "For right now it will be a matchup game," Lovullo said.
After the game, Diamondbacks RHP Taylor Clarke was activated off the paternity list and RHP Stefan Crichton was optioned to Triple-A Reno.
Diamondbacks INF Christian Walker was available off the bench after being hit by a pitch on his left arm Saturday.
Marlins: LHP Caleb Smith (6-4, 3.30 ERA) is scheduled to start the series finale Monday night. He's holding opponents to a .193 batting average, fourth-best in the majors.
Diamondbacks: RHP Merrill Kelly (7-10, 4.22) has an ERA of 2.35 in his past five road starts.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Follow Steven Wine on Twitter: http://twitter.com/Steve-Wine .
Rockies to retire Larry Walker's jersey on April 19
The Rockies will retire Larry Walker's No. 33 jersey on April 19, joining Todd Helton (17) as the only players to be so honored by the team.
Jack McDowell says Tony La Russa had sign-stealing system with White Sox in '80s
Former White Sox pitcher Jack McDowell, who never played for Tony La Russa, said a camera-aided sign-stealing system was set up by the Hall of Fame manager prior to his being fired, and that was used after McDowell made his debut in 1987.
Onley: Mets, Red Sox, Astros will have no problem replacing managers
Buster Onley breaks down the potential managerial candidates for the Mets, Red Sox and Astros after the sign-stealing scandal fallout.
Stephen A.: MLB should take away Astros' World Series trophy
Stephen A. Smith emphatically calls for the MLB to confiscate the Astros' World Series trophy and take the players' championship rings for their sign-stealing scandal.
Source: MLB ineligible list ends at death for banned players
Major League Baseball has no hold on banned players after they die, a source told ESPN, which could be significant when it comes to Hall of Fame consideration for "Shoeless" Joe Jackson and others who were banned for life and have since died.
How the internet helped crack the Astros' sign-stealing case
From video breakdowns to screengrabs to players weighing in, social media shaped MLB's first uniquely 21st century scandal.