CINCINNATI — Carlos Martinez kept getting himself into trouble and his defense kept bailing him out.

Randal Grichuk and Kolten Wong homered, and Martinez carried a shutout into the seventh inning with the help of some timely double plays as the St. Louis Cardinals snapped a three-game losing streak with a 5-2 win over the Cincinnati Reds on Sunday.

“Every time a runner gets on base, I just increase my focus,” Martinez said. “I was a little bit fatigued, but I never lost focus.”

Yadier Molina had two of the five hits for the Cardinals, who avoided being swept in Cincinnati for the first time since July 2012.

St. Louis began the day with a one-game lead over the Mets for the final NL playoff spot. New York was set to host Washington later.

Martinez (13-7) allowed three hits and all of his season-high five walks over six scoreless innings before the Reds reached him for three hits and two runs to knock him out of the game three batters into the seventh. He struck out six while improving to 8-1 in 13 road starts this season.

Cincinnati went on to load the bases with one out against reliever Zack Duke before Scott Schebler flied out. Left fielder Brandon Moss, who went 0 for 4 with three strikeouts, threw out Tyler Holt at the plate — the third of four Cardinals double plays, tying their season high.

“That was a big play,” St. Louis manager Mike Matheny said. “When a guy is struggling to put together at-bats, it’s important to come up big in big situations. That was a nice tag by (Molina), too.”

Reds manager Bryan Price had no problem with the speedy Holt trying to score.

“Offensively, we’re down by three runs and you think you’re going to be conservative, but you still have to score runs,” Price said. “Moss makes a nice play. We had to take a chance with two outs.”

Seung Hwan Oh allowed a leadoff single in the ninth before getting three outs for his 15th save.

Tim Adleman (2-3) gave up both Cardinals home runs while matching his career high with six strikeouts in his first career appearance against St. Louis. He allowed four hits and three runs with a walk in five innings.

“Outside of a few pitches, I did a pretty good job of minimizing damage,” Adleman said. “It was better today. I wasn’t in a lot of jams today. The first (home run) in the second inning, the pitch got too much of the plate. Maybe in another park, it doesn’t go out. I don’t know. The second one to Wong was a curve over the plate. You have to tip your hat. He did what he was supposed to with it.”

Grichuk followed Stephen Piscotty’s double with his 21st homer this season and second of the series, giving St. Louis a 2-0 lead in the second inning. Grichuk also homered on Friday.

Wong made it 3-0 by leading off the fifth with his fourth homer this season and second on the road trip. He also connected Monday in Milwaukee.

First baseman Joey Votto’s error and pitcher Jumbo Diaz’s error and wild pitch helped St. Louis add two unearned runs in the sixth for a 5-0 lead.

CLOCKWORK

Fireworks were set off every hour on the hour outside the ballpark as crowds gathered for the city’s annual pre-Labor Day “Riverfest” fireworks show. The 40-year-old event has been known to draw crowds of up to 500,000 people on the banks of the Ohio River. World War II-era warplanes also buzzed the ballpark before and during the game.

AND COUNTING

Grichuk’s drive extended to 23 the Cardinals’ club-record streak of consecutive games with at least one home run.

TOP DOWN

Reds pitching limited the Cardinals’ first four batters — Matt Carpenter, Jedd Gyorko, Moss and Piscotty — to a combined 5 for 43 with one RBI and six walks in the series.

TRAINER’S ROOM

Cardinals: Ex-Reds catcher Brayan Pena, limited to four games this season by left knee inflammation, was activated from the 60-day disabled list before the game.

Reds: CF Billy Hamilton, leading the majors in stolen bases, exited in the third inning after straining his left oblique while taking a strike.

UP NEXT

Cardinals: RHP Adam Wainwright (9-8) tries to snap his four-game losing streak at Pittsburgh in the opener of a three-game series Monday.

Reds: Mets RF Jay Bruce, traded by the Reds to New York on Aug. 1, returns to Cincinnati for the first time in the opener of a three-game series Monday. RHP Robert Stephenson (2-0) attempts to become the first Reds pitcher since Wayne Simpson in 1970 to win his first three career starts.