NEW YORK (AP) — A.J. Burnett has made things difficult for his manager all season. This time, he was happy to do it.

Burnett had his most impressive start in three months and Jorge Posada hit a two-run homer, leading the New York Yankees to a 6-2 victory over the bumbling Boston Red Sox in the opener of Sunday’s split-doubleheader.

READ MORE: FBI Says Body Found In Grand Teton National Park Believed To Be Gabby Petito

“I just wanted to come out and give him a headache. I’ve given him headaches all year,” Burnett said. “Why not give him a good headache?”

Burnett (11-11) allowed five hits — three to Jacoby Ellsbury, including two homers — in 7 2-3 innings, his first outing of more than six innings since he went eight on July 29. He was 0-4 in his 10 previous starts against Boston but was in control throughout this one.

“I thought his command got better and better and he just kept making good pitches,” manager Joe Girardi said. “I’m very pleased with his outing, very pleased with the job he did.”

Booed relentlessly nearly all season, the tattooed right-hander left to a loud ovation in the eighth. After receiving a high-five from his catcher and a pat on the back from Girardi, Burnett thrust his right arm in the air in acknowledgment of the cheers.

With an ERA that swelled to 5.28 coming in — second-worst behind Brad Penny among qualifying starters — Burnett seemed out of the competition for a playoff start.

Was this outing enough to change that?

“We’re going to continue to look at it and talk about it,” Girardi said. “And our opponent has something to do with who we’re going to pitch.”

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 Sunday if the Yankees swept.

The Red Sox have lost four straight and at 5-18 (.217) are on track for their worst September since going 4-18 (.182) in 1926, according to STATS LLC. Tim Wakefield (7-8) dropped to 1-5 in his last 10 starts.

“When it doesn’t go right it’s my responsibility,” Red Sox manager Terry Francona said.

Derek Jeter had three hits to lift his average to .300 at the end of a game for the first time since April 2. Starting with July 9, the day he reached 3,000 hits, he is batting .346 following a .257 start.

READ MORE: Public School 79 In East Harlem To Remain Closed Due To COVID-19 Cluster; Remote Learning In Place Until Sept. 28

“I’m not playing for a batting average,” Jeter said. I’m playing to try to stay sharp for the playoffs.”

New York improved to 6-1 on its final regular-season homestand. Having secured home-field advantage throughout the AL playoffs, the Yankees will open the division series at home on Friday night.

Sloppy in the field again, the Red Sox fell behind early for the second straight day. Catcher Jarrod Saltalamacchia had an error and a passed ball in a two-run first inning. In the fifth, he had the ball kicked out of his mitt by Jeter, who was trying to score from second base on Alex Rodriguez’s single. Jeter reached second on left fielder’s Carl Crawford’s fielding error.

The Yankees are 6-11 against Red Sox this season but have won four of last five.

Wakefield pitched four-plus innings, giving up five runs — three earned — five hits and five walks.

David Robertson got four outs to finish, twice stranding a runner on second. Hitters are 0 for their last 22 against him with runners on base, according to STATS.

Looking ahead to playoffs Girardi was able to rest his regulars, saying before the game that looking toward playoffs he has to be smart with his players.

Batting fourth for the first time since 2009 because of his experience against Wakefield, Posada connected in the third inning for his fifth homer against the knuckleballer. The 40-year-old with a diminished role this year, hit cleanup for the first time in two years and was given a curtain call on the last day of New York’s regular-season home schedule.

Brett Gardner opened the Yankees’ first with a bunt single and stole a base, drawing a wild throw from Saltalamacchia. Jeter bunted safely and Gardner moved up.

Gardner scored when Saltalamacchia fumbled the ball for an error as he tried pull it out of his oversized mitt and make a quick throw with Jeter stealing second.

After Rodriguez grounded out, Jeter advanced to third on a passed ball. Saltamacchia had a shot at nailing Jeter at third but his throw was wide of the base. Jeter scored on a wild pitch from Wakefield.

“It’s frustrating,” Wakefield said in a nearly silent clubhouse. “We can’t seem to catch a break. Certain things happen in an inning and it snowballs from there.”

MORE NEWS: Man Killed, 11-Year-Old And 2 Others Hurt In Shooting At Bronx Barbecue

NOTES: The Yankees held a brief ceremony before the game to honor Mariano Rivera for becoming the career saves leader Monday. … Girardi said he can’t “envision a scenario” where top prospect Jesus Montero isn’t on the postseason roster. … Yankees LHP CC Sabathia threw 65 pitches in a simulated game in preparation for his start Friday in Game 1 of the division series.