UPDATE: 11:55 p.m.

NEW YORK — The Red Sox salvaged their AL wild-card lead tonight when Jacoby Ellsbury hit a two-out, three-run homer in the 14th inning of the nightcap of a day-night doubleheader, lifting Boston over the New York Yankees 7-4.

The Red Sox rallied from 3-0 deficit to snap a three-game skid and head into their final series with a one-game lead over Tampa Bay.

Boston held a nine-game lead over the Rays entering play Sept. 4 but has gone 5-16 since then. Up by 1 1-2 games to start the day, the Red Sox nearly wasted that entire lead after losing the opener 6-2 despite Ellsbury’s two homers. Combined with the Rays’ 5-2 win over Toronto, the Red Sox went into the second game with a half-game lead.

Boston finishes in Baltimore, while Tampa Bay hosts the Yankees, who already have clinched the AL record and homefield advantage through the AL championship series.

Sox crumble again, wild-card lead down to 1/2 game

NEW YORK — The bumbling Boston Red Sox lost yet again, with A.J. Burnett making his most impressive start in nearly three months and Jorge Posada hitting a two-run homer that led the New York Yankees to a 6-2 victory in the opener of today’s day-night doubleheader.

Boston’s AL wild-card lead was cut to a half-game over Tampa Bay, which beat Toronto 5-2. What was a runaway nine-game advantage heading into play on Sept. 4 would be completely gone by the end of today if the Yankees swept.

At 5-18 (.217), the Red Sox are on track to their worst September since going 4-18 (.182) in 1926, according to STATS LLC.

Derek Jeter had three hits to lift his average to .300 at the end of the game for the first time since April 2.