MIAMI (AP) — Chris O'Grady looked like a much different pitcher against the Cincinnati Reds than he did five days ago.

O'Grady pitched seven scoreless innings to help the Miami Marlins beat the Cincinnati Reds 4-1 to open a four-game series on Thursday night.

"It was kind of cool because it is the back-to-back game that we talked about before where they've seen him once and who's going to make adjustments and how's he going to make adjustments," Marlins manager Don Mattingly said. "I think he had better command today."

O'Grady (2-1) allowed five hits. He struck out five and walked two. It was a much stronger outing against the Reds after allowing three runs and six walks in 4 2/3 innings against them five days ago.

"I just made a big adjustment from my last start," O'Grady said. "My last start wasn't ideal. I had a lot of walks especially early on so that was my main focus point this week was just to limit the walks and to get a good mix of pitches in and let my defense play behind me, which they did. They had some really nice plays out there."

Derek Dietrich, who drove in five of Miami's franchise-record 22 runs in a win over the Texas Rangers on Wednesday, homered and knocked in three.

"I hoped we didn't waste all of our runs last night," Dietrich said. "We had 22 of them. We could have split the difference, but we got enough to win tonight and that's all it matters. It was a good night."

Tyler Moore also drove in a run for the Marlins, who have won five of seven.

The Reds have dropped seven of eight and are 2-12 since the All-Star break.

A.J. Ramos got the final four outs for his 20th save in 22 opportunities. He entered in the eighth and got out of a bases-loaded jam after Scooter Gennett had an RBI single off Junichi Tazawa.

"Ramos was pretty good tonight," Mattingly said.

Adam Duvall popped out with two on to end the game.

Cincinnati starter Robert Stephenson (0-4) allowed three runs, four hits and seven walks in 4 1/3 innings.

"Command was a challenge tonight for sure," Reds manager Bryan Price said. "He's working his tail off. The result today just wasn't what we hoped for."

Dietrich's fifth home run of the season opened the scoring for the Marlins in the fourth.

"It was an elevated fastball — something good out over to hit and I'm starting to put some good swings on them," said Dietrich, who is 5 for 8 with eight RBIs in his last two games.

Miami pushed a couple of runs across in the fifth with Dietrich drawing a bases loaded walk issued by reliever Drew Storen and Moore hitting a sacrifice fly.

"In the bullpen I felt really well and was working on what I wanted to work on and when I got in the game I just completely abandoned it," Stephenson said. "It's not that I meant to but that's what happened out there. It's exactly the opposite of what I've been working on."

Despite eight walks to Miami hitters through five innings, the Reds only trailed 3-0.

But O'Grady kept the Reds' offense in check and received help from the defense with left fielder Marcell Ozuna connecting with relay man Miguel Rojas who fired a strike to home plate to throw out Joey Votto to end the fifth.

"I went and backed up home plate and I was watching Votto round third and the whole time I was thinking we got a shot at this with a good throw," O'Grady said. "And two good throws did it and I'm standing right there. I got to see the whole thing and it was exciting."

Dietrich's bloop single to left in the seventh extended Miami's lead to 4-0.

"Another good night for Deets," Mattingly said.

Gennett cut the deficit to 4-1 in the eighth, but Ramos got Tucker Barnhart to roll out to first on a slow grounder to end the inning.

Eugenio Suarez had three hits and Votto reached base four times for the Reds.

GORDON CLOSES IN

Dee Gordon was 1 for 3 in stolen base attempts giving him 37 steals and closing the gap behind Cincinnati's Billy Hamilton for the major league lead as Hamilton did not have an attempt and remained at 43.

Gordon was the NL stolen base champ in 2014 and 2015 while Hamilton is in search for his first title after finishing second the past three seasons.

TRAINER'S ROOM

Reds: SS Zack Cozart (quadriceps) missed his second straight game. "He's progressingly better," Price said. "He'll have to be active on the field and do all that pre-game stuff before he's considered in the lineup anytime soon. We're optimistic that it will be a short stay out of the lineup, but until you see him on the field practicing, then we're still at least a day away." ... RHP Scott Feldman (knee) is looking to throw a bullpen session in Miami with the Reds in town until Sunday.

Marlins: 3B Martin Prado (knee) is at standstill with his recovery process and surgery is a possibility. "No real progress so he's not really moving forward," Mattingly said. "We will have to make a decision - there will probably be some type of decision of what's going to happen next. We'll probably know tomorrow about that (on whether or not to have surgery)." ... RHP Edinson Volquez (knee) is planning on getting an MRI. ... LHP Wei-Yin Chen (arm) threw a bullpen session Thursday. "He seems to be doing better and the fact that he's throwing a couple of pens is a good thing so hopefully he continues to move in the right direction," Mattingly said. ... RHP Nick Wittgren (ankle) sustained an injury during Wednesday's game and his status is in question moving forward. "I'm a little worried about today," Mattingly said. "He's a guy we're going to look at and make sure is OK."

UP NEXT

Reds: RHP Sal Romano (2-2, 5.50 ERA) will make this third consecutive start since joining the rotation after the All-Star break. Romano allowed three hits and one run in six innings in a 6-3 win over Miami in his last start.

Marlins: RHP Vance Worley (0-2, 6.37 ERA) will be making his first start since June 9. Worley is 0-2 with a 7.71 ERA in four starts.