Two straight poor outings by Masahiro Tanaka to start the season didn’t alarm Joe Girardi.

“Two starts is a pretty small sample size,” he said before his ace took the mound for the third time Friday night. “I think you can overreact and I could say, ‘Oh, no, the world’s falling down.’ Or you can say, ‘He’s got a track record and my best guess is he’s going to find it.’ ”

Tanaka didn’t find it completely in the Yankees’ 4-3 victory over the Cardinals, who made their first visit to the Bronx since 2003. Still, there was far more good than bad out of Tanaka in the fifth straight victory for the Yankees (6-4).

“My mechanics, I’ve been trying to get right,” Tanaka (1-1) said through his translator. “I was able to find that as the game went on.”

The righthander, who did not surpass five innings in either of his first two starts, lasted 6 1⁄3 innings this time, allowing three runs and five hits, including a two-run homer by Matt Carpenter in the first. He was bailed out by Tyler Clippard, who escaped a second-and-third, one-out jam in the seventh after Randal Grichuk’s RBI double off Tanaka moved the Cardinals within 4-3.

Clippard got Kolten Wong to fly to short center and retired Dexter Fowler on a flyout to the warning track in right-center. “That’s the fun part about being a reliever,” he said, “coming into those jams and getting out of them. It’s fun to hand the ball off to Dellin [Betances] and then Aroldis [Chapman] after you get out of something like that.”

advertisement | advertise on newsday

Betances struck out the side in a scoreless eighth — he walked Stephen Piscotty with two outs but struck out Matt Adams — and Chapman picked up his third save in as many days with a scoreless but rickety ninth.

Chapman walked Grichuk with two outs and gave up a double to pinch hitter Jose Martinez, who lined a 1-and-2 fastball into the leftfield corner. Third-base coach Chris Maloney initially waved Grichuk home, but when Brett Gardner came up with the ball quickly, Grichuk held at third.

“If they did send him, I was pretty confident we’d have him out,” catcher Austin Romine said.

Chapman, who continues to utilize a slider and changeup he worked on throughout spring training, got ahead of former Cubs teammate Fowler 0-and-2 before inducing a grounder to second to end it.

“I feel bad for the hitters, to be honest with you,” Betances said of Chapman developing his secondary pitches to go with a 100-mph-plus fastball.

Yankees videos

The back end of the bullpen stranded five runners in the last three innings. “When we’ve got the pen coming in,” Romine said, “there’s no worries.”

And, for one night, far fewer regarding Tanaka.

The Yankees scored what proved to be the winning run in the fifth, aided by some sloppy play by the Cardinals. Jacoby Ellsbury singled with one out and Chase Headley ripped a double into the rightfield corner. Third-base coach Joe Espada initially held up Ellsbury, but second baseman Wong’s wide relay throw to catcher Yadier Molina got past Molina’s backhanded attempt to grab it. Michael Wacha backed up the play, but his throw to Molina got away as Ellsbury reached the plate, and the error charged to Wong gave the Yankees a 4-2 lead.

Starlin Castro and Romine hit home runs off Wacha to pace the Yankees, who had nine hits. Castro’s two-run shot in the first tied it at 2 and Romine’s solo shot in the second gave the Yankees a 3-2 lead.

Wacha allowed four runs (three earned), nine hits and two walks in six innings. He struck out eight.