BOSTON – Six losses in the first six games were plenty for Dustin Pedroia.

So he hit a solo homer in the first inning Friday, starting his team to a 9-6 victory against the New York Yankees and ending Boston’s longest season-opening losing streak since World War II.

“I just came in here thinking, ‘We need to find a way to win. I don’t care how we do it. I don’t care if it’s the ugliest win of all time. We need that win,’ ” Pedroia said. “But we played great, man.”

Pedroia had three hits and three RBI in the 100th home opener at Fenway Park.

With a full house cheering from the start of player introductions, the Red Sox rapped 12 hits after getting just 35 in their first six games. They started the season on the road by going 0-6 for the first time since beginning the 1945 season at 0-8.

“It seems like guys were calm, weren’t jumping at the ball,” Pedroia said. “This is our park. We were on the road six days and we didn’t get comfortable.”

The Red Sox had been a popular preseason choice to win the World Series after adding Carl Crawford and Adrian Gonzalez to support what seemed like a strong rotation.

“We have a lot of expectations, too,” Pedroia said. “We don’t want to let anybody down.”

But the struggles of the starting pitchers continued when John Lackey (1-1) gave up six runs in five innings. He has allowed runs in eight of the nine innings in which he’s appeared this season.

Lackey still got the win when Jarrod Saltalamacchia’s run-scoring double broke a 6-6 tie in the fifth.

Jonathan Papelbon, coming off his worst season, got the save with a perfect ninth as Boston won its seventh straight home opener.

J.D. Drew gave him a three-run lead with a two-run single in the seventh.

“It feels great,” said David Ortiz, who went 2 for 4 with an RBI. “We were just waiting to get home so we can win. Just kidding.”

The game started poorly for the Red Sox. Lackey walked the first batter, Brett Gardner, who stole second. After a walk to Alex Rodriguez, Robinson Cano drove a two-run double to center.

Boston also showed some pop early when Pedroia hit his first homer of the year just inside the left-field foul pole.

“He gave us a huge lift,” Manager Terry Francona said. “We’re down two, he takes a good swing and kind of gets at least a little bit of momentum, a little bit of excitement going.”

The Yankees went ahead 3-1 in the second on doubles by Curtis Granderson and Gardner before the Red Sox scored five in the bottom of the inning. They hadn’t scored more than five in a game in any of their first six losses.

The runs came off Phil Hughes, who was hammered for his second straight outing and lasted just two innings.

“It seemed like everything I threw up there was getting hit around,” he said.

Boston loaded the bases in the second on singles by Drew, Saltalamacchia and Jacoby Ellsbury, and scored when Marco Scutaro grounded into a forceout at third. Then Pedroia drove in two runs with a single, and Gonzalez and Ortiz singled in a run apiece for a 6-3 lead.

Lackey kept struggling, giving up an RBI double to Cano in the third, a run-scoring single to Derek Jeter in the fourth and a homer to Rodriguez, his third of the season, in the fifth.

That made it 6-6, but Boston went ahead in the bottom of the fifth against Bartolo Colon (0-1) on a double by Saltalamacchia that scored Kevin Youkilis, who had drawn his third walk.

“They’ve got a great team,” Yankees catcher Russell Martin said. “(Going) 0-6 is not a good indication of how they’re playing.”