NEW YORK — Sweat was streaming down CC Sabathia’s face to the point where he said he couldn’t see. He stomped around the mound, shouted and swore encouragement to himself.

Oh, he also had a little extra kick on his fastball.

Sabathia had what he acknowledged was his best outing in a trying season Thursday night, pitching six intense innings and helping the New York Yankees beat the Boston Red Sox 2-1 behind Jacoby Ellsbury’s slump-busting, tiebreaking homer.

“I was all fired up,” Sabathia said.

Alex Rodriguez had an RBI double and Justin Wilson (4-0) struck out three batters in the seventh to help the Yankees take two of three from the last-place Red Sox.

The AL East leaders next face a pair of Cy Young Award winners, R.A. Dickey and Toronto newcomer David Price, when they take on the streaking Blue Jays in a key weekend series. The division rivals, separated by 41/2 games, play the first of 13 remaining games against one another Friday night.

“We know how explosive they are,” Yankees Manager Joe Girardi said. “We just have to make pitches.”

Dellin Betances gave up a hit in the eighth. Andrew Miller put two on in the ninth but struck out Rusney Castillo to remain perfect in 24 save chances.

Ellsbury connected with two outs in the seventh off 22-year-old Eduardo Rodriguez (6-4), who beat the Yankees once this year.

The former Red Sox center fielder was in a 3-for-23 slump entering Thursday. His average had dipped from .322, when he returned from the disabled list on July 8, to .277 coming in.

“I’ve been feeling pretty comfortable at the plate,” Ellsbury said. “I just knew it was a matter of time.”

Sabathia left his previous start with dehydration, wilted by the Texas heat. He was ornery in this outing, yelling at plate umpire Rob Drake over a called ball early on and shouting while giving a fist-pumping shimmy after striking out David Ortiz on a 94 mph two-seam fastball with the bases loaded to end the fifth.

Sabathia’s fastball this season was averaging just 90.1 mph, according to fangraphs.com.

“He threw me some good pitches,” Ortiz said. “Tonight was the best I have seen him in a while. He was locating his pitches well.”

The big left-hander had just walked Xander Bogaerts following Castillo’s run-scoring single that ticked off the glove of diving shortstop Didi Gregorius to tie it 1-all. Castillo’s hit came right after Sabathia walked .100 hitter Jackie Bradley Jr.

Eduardo Rodriguez intentionally walked Alex Rodriguez to load the bases in the bottom half, but Mark Teixeira and Chris Young popped out.

NOTES: At his request, OF Mookie Betts saw concussion specialist Dr. Michael Collins in Pittsburgh. “As far as I know, reports were good,” general manager Ben Cherington said. Betts is expected to join the Red Sox in Detroit this weekend, but there is still no target date for his return. … Cherington said top prospect Brian Johnson, a first-round draft pick in 2012, has inflammation around his pitching elbow but there is “no evidence that there is anything going on around the ligament.”