JUPITER, Fla. -- After watching a three-run Marlins lead disappear, Marcell Ozuna provided a boost with a home run in the sixth inning that lifted Miami to a 4-3 win over the Cardinals on Thursday afternoon at Roger Dean Stadium.

It was the first spring homer for Ozuna, who has scuffled over the past few weeks, and it snapped a 3-3 deadlock. The drive to left came off reliever Scott McGregor.

"Sometimes, with young players, but even for older players, to get that one big hit, it takes the pressure off," manager Mike Redmond said of Ozuna's tie-breaking shot. "You saw his next at-bat was good as well. Hopefully, that will jump-start him in these last 10 games."

Jose Fernandez pushed his pitch count up to 88 over six innings, but the right-hander also allowed three runs on five hits. He struck out eight and walked two.

For St. Louis, Lance Lynn worked four innings, giving up three runs on four hits with five strikeouts.

"The first two innings, we were doing what we wanted to do, moving the ball in and out," Lynn said. "The next two innings, we started mixing in the breaking balls. The last inning, I got myself into a situation where I was going to throw a breaking ball for a strike no matter what, and I kept throwing it for a ball.

"For the most part, the fastball, cutter and changeup were right where I wanted to be, and the curveball wasn't today. That's the next pitch [to come], the one you need the most feel with, because it's got more of a break and things of that nature. It's coming."

St. Louis erased a three-run deficit with three runs in the sixth inning. Three straight hits got the inning going off Fernandez.

Jhonny Peralta doubled and scored on Daniel Descalso's RBI single. Peter Bourjos laced an RBI triple to right, and the Cardinals tied it on Jon Jay's bad-hop RBI single. It was a scary moment for the Marlins, because the ball redirected and clipped second baseman Derek Dietrich in the face.

Dietrich was down for about a minute before he got on his feet, and he was escorted off the field by assistant trainer Mike Kozak.

The Marlins got on the board in the third inning, manufacturing a run on Dietrich's fielder's-choice RBI. Adeiny Hechavarria, who singled, scored when Dietrich's groundout to second.

In the fourth inning, Miami added two runs on Jarrod Saltalamacchia's RBI double and Hechavarria's run-scoring single, making it 3-0.

Fernandez retired the first five he faced, including strikeouts of Allen Craig and Yadier Molina on breaking pitches in the second inning. St. Louis' first hit was a single by Peralta.

The Cardinals mounted a mild two-out threat after Peralta's single, as Descalso walked. But Fernandez fanned Bourjos on an offspeed pitch.

Up Next: After returning to Mexico to get his work visa, Aledmys Diaz has come back to camp and is expected to make his Grapefruit League debut for the Cardinals in Friday's game against the Nationals. Manager Mike Matheny would not confirm whether Diaz, a 23-year-old Cuban shortstop, would start or come in off the bench. Adam Wainwright will start for St. Louis and oppose Washington's Gio Gonzalez in the 12:05 p.m. CT game.