BOSTON — Jackie Bradley Jr. ripped a long two-out, two-run home run to cap a three-run eighth-inning rally and lift the Boston Red Sox to a 5-3 victory over the Detroit Tigers in the opener of a three-game series Friday night.

After Mitch Moreland, who homered and doubled earlier, tied the game with an RBI single, Bradley hit a 1-1 pitch from Alex Wilson (1-3) over the visitors’ bullpen in right field for his eighth homer of the season.

The inning started when right fielder J.D. Martinez failed to catch up to a Xander Bogaerts pop fly in short right before Bogaerts took second on Wilson’s wild pickoff throw.

Matt Barnes (4-2) pitched the top of the eighth and got the win and Craig Kimbrel worked a perfect ninth for the 18th save of his dominant season. He had two strikeouts, ending the game with Miguel Cabrera’s fourth strikeout in five at-bats in the game.

The win, the Red Sox’ fourth in 29 games when trailing after seven innings, ended Boston’s two-game losing streak. They had scored just three runs in their previous 25 innings before erupting in the eighth.

The Tigers, who have lost three of their last four, got six solid innings from Jordan Zimmerman, who turned in his second straight quality start.

Nicholas Castellano and Mikey Mahtook homered and Martinez and Jose Iglesias both had three hits for the Tigers (29-31).

The homers came off left-hander Brian Johnson, who was reached for eight hits and three runs in 4 1/3 innings after being summoned from the minors earlier in the day by the Red Sox (33-27).

Any chance of a second straight Johnson shutout was quickly lost when Castellanos homered for the second straight day, with one out in the first. Three straight singles, the third by Justin Upton, made it 2-0 later in the first.

Mahtook led off the fourth with his fourth homer of the season, but Moreland answered that leading off the bottom half. Bradley’s RBI single made it 3-2 but Hanley Ramirez was thrown out at third on the hit — and Pablo Sandoval slammed into an inning-ending double play with runners on first and second.

An infield single by Victor Martinez knocked Johnson out of the game with one out in the fourth and Heath Hembree was greeted by a long double from J.D. Martinez. With runners at second and third and one out, Hembree escaped to leave the score at 3-2.

NOTES: Boston manager John Farrell met with LHP David Price concerning Price’s outburst at the media in New York Wednesday night. … Tigers 3B Nicholas Castellanos made his 12th error of the season, high among all 3Bs and three more than he made in 108 games last season. … The Red Sox activated 2B Dustin Pedroia and recalled LHP Brian Johnson from Triple-A Pawtucket and both started, Pedroia going 0-for-4 — while 1B Sam Travis and RHP Brandon Workman were both optioned back to Pawtucket. … The Tigers activated C James McCann and sent C John Hicks back to Triple-A Toledo. … Tigers RHP Justin Verlander and Red Sox LHP Chris Sale go head-to-head for the sixth time in their careers Saturday night. The Tigers have won all five previous games, four of them when Sale was with the Chicago White Sox, Verlander going 2-0 and Sale 0-2. Verlander left his last start with right groin tightness but threw a 33-pitch bullpen session Thursday and reported no problems. … Friday night was Pride Night at Fenway.