MIAMI -- Two months removed from the majors, Miami Marlins right-hander Jarred Cosart found himself back on the mound with the division-leading New York Mets in the thick of a pennant race.

Cosart looked healthy and showed flashes of his 2014 self in a no decision in the Marlins' 4-3 walk-off victory over the Mets -- their second of the series -- on Sunday afternoon.

The 25-year-old righty tossed 4 2/3 innings, allowing five hits with a Yoenis Cespedes homer -- the second batter of the game -- as his lone blemish. He struck out three and walked one. Of his 88 pitches, 54 went for strikes.

More from FoxSports

It took 21 pitches to get through the first and another 20 in the second as a 6-4-3 double play worked him out of a jam and kept it a 1-1 ballgame.

"I was really nervous," Cosart said. "Obviously you want to come out with a good showing. I've been off for two months, haven't seen the guys, tried to come back, had a relapse. To feel healthy was No. 1, and I did that. I got a little tired at the end. Obviously still working up to get in shape and the mental exertion in the big leagues is a lot different than rehab starts. Continuing to get my feet back under me, move forward and just finish strong."

Manager Dan Jennings and pitching coach Chuck Hernandez expected somewhere between the 75-80 pitch range entering the game.

Following those first two frames, Cosart permitted just two more hits -- a pair of two-out doubles to Michael Conforto and Juan Uribe in the third and fourth, respectively. His efficiency allowed him to pitch into the fifth with the bottom of the order up. When the lineup turned over and Cosart surpassed his limit, Jennings went with lefty Chris Narveson.

Cosart struck out two batters with fastballs and Kevin Plawecki in the fifth on an 82 mph curveball. His changeup is also a pitch he is hoping to implement more. He induced nine grounders.

"When I threw it for strikes today it was very good.," Cosart said of his offspeed. "Later in the game it got better. Obviously I need to throw it. Probably going to start throwing it earlier in the game. I threw a lot of fastballs early and they came swinging. Cespedes is obviously on fire. Throw a guy enough fastballs and they'll catch up to it -- doesn't matter how fast it is. Just continue to work on that. I threw a really good changeup to Conforto I thought that he hit for a double to left-center. ... I was able to keep them off balance throughout the game. Getting it over for strikes early is going to be huge."

Part of the Opening Day rotation, Cosart dealt with two bouts of vertigo -- the second of which came in the minors when he was diagnosed with an inner-ear disorder. When he returned the first time, Cosart made just two appearances before being optioned to Triple-A New Orleans on July 5.

His troubles in 2015 fit along with the trouble Miami has encountered as a whole both on the injury and underperformance fronts.

After the Marlins acquired him from the Houston Astros during last year's trade deadline, he went 4-4 with a 2.39 ERA in 10 starts. Miami expected him to be a front-end starter. Instead, he posted a 1-4 record and 5.36 ERA in nine outings (eight starts).

"He did an outstanding job driving the fastball down, he had the natural cut life to it," Jennings said. "I thought he challenged the strike zone real well. Chuck and I were real pleased he attacked the strike zone. I thought that was big.

"It's good to see. That looked like the Cosart from last year that we had counted on coming in. I know there's a peace of mind for him knowing he's back, he's healthy and able to go out an feel like his old self."

Cosart's return should bolster a pitching staff full of young arms reaching career highs in innings. The Marlins regain one of their promising pitchers as the National League East's third-place ballclub tries to play the role of spoiler over the final month.

"I was hoping to keep us in it and give us a chance to win it," Cosart said. "For us to pull out two how we have... (Martin) Prado's come up huge. Everybody's swinging the bat well. Timely hitting. Pitched pretty well for the most part and played good defense. That'll win you games. The overall goal for the Miami Marlins is to finish strong. I've had a down year -- injury a lot to do with that. We've had some freak injuries, some non-freak injuries. We've had everything happen that could possibly happen. There was a lot of high expectations. We're just trying to finish September off strong and hopefully play spoiler going forward."

You can follow Christina De Nicola on Twitter @CDeNicola13 or email her at cdenicola13@gmail.com.