BOSTON Aaron Cook thought he might surprise Miguel Cabrera with a curveball in the dirt and catch the Detroit slugger swinging with two strikes.

Cook got Cabrera to swing, but the pitch was a foot or two above the dirt and Cabrera knocked it over the Green Monster for a two-run homer in the Tigers’ 7-5 win over the Boston Red Sox on Wednesday night.

“I was hoping to just change what I had been doing. I’d been really pounding him sinkers and four-seamers away and he was fouling them off,” Cook said. “I was just trying to mix in something different. In hindsight, I probably should have just stayed out there and let him keep fouling them off.”

Cook (2-5) tried another curveball on his very next pitch and Prince Fielder also gave it a ride, sending a shot to straightaway center for Detroit’s fifth run of the fifth inning to put the Tigers up 6-1.

“When I’m making bad pitches to the best hitters in the game and just leaving them up, they did exactly what they were supposed to do with those pitches,” Cook said.

Delmon Young added a solo homer for Detroit, which won for just the second time in seven games and avoided a three-game sweep at Fenway Park.

Carl Crawford hit a solo homer for the Red Sox, who had a four-game winning streak halted.

Cody Ross, Will Middlebrooks and Pedro Ciriaco had RBI singles for Boston, which pulled within 6-5 before Young’s solo shot in the eighth.

“That’s the way it’s supposed to be – down by five runs and you make it a ballgame,” catcher Jarrod Saltalamacchia said. “We still won the series. That’s the positive note. We’ve got to look at that.”

The Tigers finished 2-5 in Fenway Park and were 5-5 overall in the season series against the Red Sox.

Rick Porcello (8-6) pitched 5 2-3 innings, giving up four runs on eight hits for the win. He was 0-2 with a 10.80 ERA in three career starts against Boston.

Cook was hit hard for the second straight start, allowing six runs on nine hits, including two homers, in 4 2-3 innings.

Octavio Dotel and Joaquin Benoit each worked a scoreless inning before Jose Valverde pitched a perfect ninth for his 21st save in 25 chances.

Detroit chased Cook and broke a 1-all tie with the big fifth. Alex Avila and Jhonny Peralta opened with singles and advanced on Ramon Santiago’s sacrifice. Austin Jackson followed with an RBI single and Quintin Berry had a run-scoring ground out.

Cabrera then hit a towering flyball completely out of Fenway over the Green Monster seats and Fielder hit a shot into first row of the center field bleachers, making it 6-1.

“You don’t really expect a guy to swing on a first-pitch curveball after a home run,” Saltalamacchia said.

In the sixth, the Red Sox cut it to 6-4. Boston had loaded the bases with no outs, but Saltalamacchia bounced into a double play that scored a run and Middlebrooks had an RBI single. Phil Coke relieved and allowed Ciriaco’s RBI single before he struck out Jacoby Ellsbury.

Crawford homered off Coke in the seventh, but Young homered in the eighth to restore Detroit’s two-run edge.

The Red Sox had jumped ahead 1-0 in the first when Ross had a two-out RBI single after Ellsbury doubled leading off.

The Tigers tied it in the fourth on Brennan Boesch’s RBI single on an eight-pitch at-bat. But Ellsbury saved a run with a running over the shoulder catch to end the inning, stumbling and falling forward into the side of Boston’s bullpen as he came to the ground. He went into the `pen with his right shoulder, the same one that caused him to miss 79 games after he dislocated it in Boston’s home opener.