The Yankees’ problems run much deeper than where their aging shortstop is hitting in the lineup.

That was proven again on Tuesday, as the Red Sox piled another scoop of dirt on what’s left of the Yankees’ season with a 9-4 rout in The Bronx.

The Yankees, coming off a road trip that significantly damaged their postseason chances, began what could be a last-gasp nine-game homestand with an ugly defeat. It was their third straight loss and fifth in seven games.

Nevertheless, Mark Teixeira bristled when asked about the team having a sense of urgency this late in the season.

“There has been for a while,” the first baseman said. “It’s not like you can say, ‘OK, we’re going to go out and win tonight.’ We’ve been battling all year. The effort level is there. That’s not gonna change no matter what the standings are.”

They don’t look good, as the fading Yankees are now five games back of the Tigers for the second AL wild-card spot.

“I wouldn’t say do-or-die,” manager Joe Girardi said of the stretch to open September at Yankee Stadium. “But I’d say it’s really pretty important. We obviously need to win a lot of games on this homestand.”

Despite having scored the fewest runs in the AL, last-place Boston raced to a 6-0 lead in the third and hit three homers.

Even a two-run rally in the fifth ended poorly for the Yankees. A base-running gaffe by Martin Prado gave Boston its first out of the inning then Brett Gardner struck out looking to end it, getting tossed in the process.

Prado didn’t realize Carlos Beltran and Brian McCann hadn’t immediately taken off on his fly ball over left fielder Yoenis Cespedes and was hung up between first and second. But a pair of walks then an infield single by Derek Jeter made it 7-3 as the Stadium crowd finally came to life.

Gardner, representing the tying run with the bases full, then took a 2-2 fastball from Boston starter Joe Kelly that was outside, but home plate umpire Tim Timmons called strike three.

Gardner slammed his helmet and was ejected immediately. He was replaced in the lineup by Stephen Drew, who went to second base and Prado moved from second to left field.

“I felt like I got the bat taken out of my hands there in a really big situation,” Gardner said. “The pitcher was on the ropes. I let my emotions get the best of me.”

Instead of a full count, it was Gardner’s third strikeout of the game.

“It was way outside,” Gardner said. “I was pretty angry.”

Gardner also said he would react the same way again given the chance.

Girardi didn’t blame Gardner, saying only, “Let’s just say [Red Sox catcher David] Ross did a heck of a job.”

Though the Yankees routinely have gotten good starting pitching throughout the season, despite injuries throughout the rotation, Tuesday was not one of those nights.

Rookie right-hander Shane Greene (4-2) allowed six runs in just 2 2/3 innings, the worst start of his young major league career.

Oddly, no one came out to the mound during the decisive third inning as Greene fell apart. He allowed a single, two walks and a pair of homers in the frame before Girardi finally replaced him with Esmil Rogers.

Girardi said he generally leaves mound visits to pitching coach Larry Rothschild.

If they don’t figure things out soon, it won’t matter who is making the calls.