BOSTON -- For the first time since 2006, Game No. 162 of the regular season meant closure for the Red Sox. Before the game, players were signing bats for each other and packing up other keepsakes.

It was a day to say goodbye for a while, and the Red Sox did so by pulling out an 8-4 victory over the Yankees that prevented their rivals from winning the American League East title.

However, the Yankees will be in the postseason as the AL Wild Card entrant after finishing at 95-67. The Rays are the AL East champs.

The Red Sox? Besieged by injuries to key players all season, they stayed in the race until the final week of the season and finished 89-73.

"We'd still be playing right now if a lot of things wouldn't be happening. I can pretty much guarantee you that," said right-hander John Lackey, who earned the win.

Lackey, who wasn't as consistent as he hoped in his first season with Boston, closed out with a strong performance. The big righty went 7 2/3 innings, allowing six hits and three runs while walking two and equaling his career high with 10 strikeouts. He threw 118 pitches.

Lackey finished the year 14-11 with a 4.40 ERA.

"I mean, I got a win today, but I felt like I've been pitching pretty decent for a little while now," said Lackey. "[It was a] learning experience. It was definitely up and down. I like some of the new tools I've added this year with [pitching coach] John Farrell, so I think moving forward, it's going to be good."

Jed Lowrie paced the offense, smashing two home runs.

For Lowrie, it was also a momentum boost going into the offseason. After missing the first half of the season with mononucleosis, he had some nice production down the stretch, hitting .287, with nine homers and 24 RBIs in just 171 at-bats.

"I feel good," said Lowrie. "I still feel like I'm continuing to get stronger. I'm happy with the way I played and the way my body responded."

J.D. Drew gave the Red Sox an early jolt, pummeling a two-run homer over Boston's bullpen and into the bleachers in right-center to make it 2-0 in the bottom of the first. It was No. 22 on the season for Drew.

Nick Swisher got one of those runs back for the Yankees in the second, when he ripped a solo shot to right against Lackey. With two outs in the third, New York was granted an opportunity when Drew dropped a routine fly ball to right, allowing Mark Teixeira to reach on a two-base error. Alex Rodriguez followed with an RBI single up the middle to tie the game on a run that was not charged to Lackey.

But Lowrie untied it in the fifth, when he roped a two-run shot to right into the visiting bullpen in right.

From there, the momentum stayed with the Red Sox. David Ortiz led off a three-run sixth with a bunt single. He then came out for pinch-runner Josh Reddick. The crowd gave Ortiz a mammoth ovation as he walked off the field for the final time in 2010. He came back out for a curtain call. The Red Sox hold a $12.5 million option on the big slugger for '11.

"Suffice it to say, we're certainly interested in having him back next year, and we'll sit down and talk it through," said general manager Theo Epstein. "But it was another great year for him."

Boston captain Jason Varitek, who is eligible for free agency this winter, got a loud ovation in his final at-bat and just missed a home run. His drive to right was caught just in front of the bullpen by Swisher.

"I hit the ball really well," said Varitek. "If I pull it down the line, it goes way out. Anything to center [or] left-center today wasn't really happening. We were joking around, but I was trying to be aggressive [with] my swing. I swung and missed at the first one. Hit the second one really good. More times than not, when I find the barrel like that, the ball caries well."

With two on and nobody out in the sixth, Ryan Kalish ripped an RBI single. The Red Sox then went into aggressive running mode. Bill Hall and Kalish pulled off a double steal. After an intentional walk to Daniel Nava, Lars Anderson delivered a sacrifice fly to right. The Sox then executed another double steal, with Kalish executing a backdoor theft of home as Nava nabbed second. That made it 7-2.

Lowrie's second homer of the day made it a six-run bulge.

Jonathan Papelbon pitched Boston's final inning of 2010, allowing an unearned run.

The Red Sox will be back in four months when they gather under the warm sun of Fort Myers, Fla.

"Every year we go to Spring Training, our guys manage to put a team together that we feel like will have a chance to compete," Francona said. "That won't change."