NEW YORK (AP) — Raul Ibanez and the New York Yankees are quite fond of their position — leaving the chasing to the Birds.

Ibanez tied it with a pinchhit two-run homer in the ninth inning, then had an RBI single in the 12th, helping the Yankees remain a game up on Baltimore in the AL East with one game to go by beating the Boston Red Sox 4-3 on Tuesday night.

With a second comeback spurred by Ibanez in the last 10 days, the Yankees need a win or Orioles loss on the final day of the season to secure their 13th division title since 1996. The Orioles beat Tampa Bay 1-0 earlier.

If the teams end up even after today’s games, they’ll play a tiebreaker Thursday in Baltimore.

The Yankees kept missing chances on a foggy, rainy night. They were 0-58 when trailing after eight innings this season before rallying in the ninth.

Curtis Granderson led off the ninth with a single off closer Andrew Bailey and Ibanez lined a shot to right field to make it 3-all.

Ibanez came up again with two outs in the 12th against Andrew Miller (3-2) following a walk to Francisco Cervelli in his first plate appearance of the year and a free pass to Granderson.

The 40-year-old first-year Yankee then hit a grounder out of the reach of shortstop Jose Iglesias and Cervelli flopped into home plate.

Derek Lowe (9-11) pitched two innings for the win.

Tying a season high with their seventh straight loss, the Red Sox dropped to 69-92, ensuring they will finish in last place in the East for the first time since 1992.

The Yankees had at least one hit in each of the first six innings before the top three in the batting order went out successively in the seventh against Junichi Tazawa.

After Ibanez’s homer, they loaded the bases against Bailey in the ninth but Mark Melancon relieved and got Teixeira to pop up to an outfield playing in and Robinson Cano to ground out.

Ibanez has 19 homers this season, 10 of them tying the game or putting New York a lead.

Managing as if this were a playoff game, Girardi used much of his well-rested bullpen. He called on Rafael Soriano for the ninth, trailing 2-1, and the closer gave up a leadoff homer to James Loney, rankling many of the 41,564 who stayed through the rain.

He also pitched the 10th, walking one batter. It was the first time this season Soriano pitched more than 1.1 innings. Soriano threw 43 pitches, his most since Sept. 25, 2005.

Jacoby Ellsbury and Dustin Pedroia were back in Boston’s lineup a day after sitting out of a 10-2 loss.