MIAMI (AP) -- R&B blared in the St. Louis Cardinals' postgame clubhouse, making conversation difficult, and Justin Masterson reached over to the stereo and turned down the volume so he could talk about his latest outing.
Masterson did it all Wednesday- pitching, hitting and monitoring the music after St. Louis beat the Miami Marlins 5-2.
The former Indians ace earned his first career RBI in the sixth with a two-out single. But he was more excited about pitching seven scoreless innings in his best outing since being acquired in a trade with Cleveland on July 30.
''I pray to the good lord that this is on the right path,'' said Masterson, who has struggled for much of the season. ''I felt very comfortable. The ball was coming out well and it was heavy. And it was going at guys; that's nice, too.''
The 6-foot-6 sinkerballer recorded 12 outs on groundballs. He also bounced a grounder through the Miami infield for his RBI, and when asked if he got the ball as a souvenir, he laughed.
''I got a W,'' he said. ''It's much better for the team than the ball.''
Masterson improved to 2-1 with St. Louis and 5-6 overall. He allowed three hits - all singles - and no walks and threw only 91 pitches before departing for a pinch hitter.
After recording only six outs in his previous start, he lowered his ERA to 6.00 in three outings with the Cardinals, and 5.14 overall this year.
''Today was just a great sign of the kind of pitcher he can be when he gets it all put together,'' manager Mike Matheny said. ''It couldn't have happened at a better time.''
The Marlins were going for their first three-game sweep of the Cardinals since 1996, but they didn't get a runner to second base until the ninth.
''Absolutely we wanted to get greedy and try to go for the sweep,'' Casey McGehee said. ''But Masterson threw the ball well.''
Miami walked in a run and allowed two unearned runs on a pair of errors by second baseman Jordany Valdespin. Nathan Eovaldi (6-7) allowed four runs, two earned, in six innings.
Jeff Baker hit a two-run homer for the Marlins, but NL home run and RBI leader Giancarlo Stanton went 0 for 4 with two strikeouts.
The Cardinals won despite going 2 for 11 with runners in scoring position. They were 4 for 26 in those situations in the series, which made a two-out, two-run single by Matt Adams in the third inning especially welcome.
''Somebody in the dugout yelled real loud, 'Hey, we got the lead,''' Matheny said. ''That was a nice change of pace.''
Masterson made the early advantage stand up.
''You get two or three runs and you can challenge guys and go after them,'' he said.
Marlins manager Mike Redmond caught Masterson in 2010 when both were with the Indians.
''He's a totally different guy than I caught,'' Redmond said. ''He definitely relies on his location and changes speeds, but he still gets a ton of groundballs. We never got anything going against him.''
Redmond also caught the Marlins' starter Thursday, Brad Penny, when both played for Florida.
Cardinals LF Matt Holliday left the game in the seventh inning when his chronic knee trouble flared up, but he said the problem wasn't serious.
Marlins LHP Dan Jennings, who suffered a concussion when he was hit in the head by a line drive on Aug. 7, has been free of symptoms the past two days and played catch before the game. There's no timetable yet for his return.
Redmond said he anticipates that RHP Carter Capps (elbow) and INF Derek Dietrich (wrist) will rejoin the team next month.
The Cardinals open a homestand Thursday against the Padres when John Lackey pitches against Eric Stults. Lackey has an 8.25 ERA in two starts since joining St. Louis.
Penny pitches Thursday against Arizona and Chase Anderson. Penny has a 1.93 ERA in 23 games against the Diamondbacks.