Mark Teixeira gave the Yankees a week’s worth of offense with one swing of the bat last night — a third-inning grand slam.

But it wasn’t until Brett Gardner’s two-run single in the sixth that the Yankees finally took the lead for good in a 7-4 win over the Indians, just their second victory in nine games.

“Up 4-1 with Andy [Pettitte] on the mound, we needed this win,” Teixeira said. “We’ve had a rough enough streak the last week and a half as it is.”

With the Yankees offense in shambles, low-key owner Hal Steinbrenner publicly challenged the team prior to the game.

“We’re right in the middle of the fight and it’s gonna continue,” Steinbrenner said. “But we do need to start hitting, no doubt about it. They know that.”

The offense picked up Pettitte, who was making his first start since being removed from a May 16 outing with upper back spasms.

He gave up just one run until faltering in the fifth, in which he threw 10 straight balls at one point. Pettitte managed to get two outs before Carlos Santana’s two-run ground-rule double bounced off David Adams’ glove at third into the stands, tied the game at 4-4 and ended his night.

But the bats and the bullpen bailed him out.

Winning pitcher Shawn Kelley, Joba Chamberlain and David Robertson pitched scoreless relief before Mariano Rivera earned his 20th save.

It was Teixeira’s first home run since suffering a right wrist injury preparing for the World Baseball Classic in spring training, and he pumped his fist as he rounded first.