In his final chance to impress the fans voting for the last spot on the AL All-Star team, Chris Sale pitched 7 2-3 innings of four-hit ball.

Then the White Sox bullpen gave the game away.

Jake Petricka failed to record an out, helping Boston turn a four-run deficit into a one-run game, then Javy Guerra gave up consecutive run-scoring hits in the bottom of the ninth and the Red Sox rallied to beat Chicago 5-4 on Wednesday night.

“Put that all on me. I’ve got to go in there and shut the door,” Guerra (0-1) said. “He deserves a win every time he throws the ball that way. The guy’s special. He deserves a win.”

Daniel Nava doubled in the tying run and scored the game-winner on Brock Holt’s single with one out in the bottom of the ninth to help the Red Sox snap a four-game losing streak.

Koji Uehara (5-2), who was added to the AL All-Star team earlier Wednesday, earned the win.

Sale, who is a candidate for the last spot on the AL roster,  is hoping to join the Red Sox closer in Minneapolis next week. The winner of the fan voting will be announced Thursday and Sale, an All-Star the last two seasons, walked none and struck out six before his bullpen cost him a chance to improve to 9-1.

“He’s one of the best pitchers in the game,” Nava said. “Whether he’s an All-Star or not, he’s an All-Star-caliber pitcher.”

Petricka faced four batters in the eighth and gave up three hits and a walk. It was 4-3 by the time Guerra retired Mike Carp to end the eighth. But Guerra couldn’t finish it in the ninth, hitting Mookie Betts with one out and then giving up hits to Nava and Holt.

“Once we got Sale out of the game, then we were able to create opportunities,” Red Sox manager John Farrell said. “Tip your hat to a very, very good pitcher. But we didn’t roll over by any means.”

Jose Abreu and Conor Gillaspie homered to help stake Chicago, which had won three straight, to a 4-0 lead. Sale did not allow a runner to reach third base until the eighth, when Betts led off with an odd double — he beat out an infield single and took second when he noticed no one was covering — then moved up on a groundout.

After getting Holt to ground out, Sale was replaced by Petricka.

And that’s when the Red Sox, who had lost seven of their first eight games on the homestand, rallied.

Abreu hit a solo homer to deep center field in the first inning, his 28th of the season. Only Mark McGwire, who had 33 homers at the 1987 All-Star break, hit more in the first half of his rookie season.

Gillaspie added a solo shot in the second, and the White Sox made it 3-0 when he doubled and scored in the fourth. Tyler Flowers and Adam Eaton had consecutive doubles in the seventh to make it 4-0.

It stayed that way until White Sox manager Robin Ventura pulled Sale with two outs in the eighth, and Petricka couldn’t get an out.

NOTES: C Christian Vazquez was making his major league debut. Earlier Wednesday, the Red Sox designated C A.J. Pierzynski for assignment. … Sale would be the first White Sox pitcher to make three straight All-Star teams since Jack McDowell in 1991-93. … It was the earliest date that the Red Sox have started five rookies since 1952. … Uehara was named to the All-Star team as a replacement for Yankees starter Masihiro Tanaka, who was placed on the DL on Wednesday…. Rubby De La Rosa, who was recalled from Triple-A earlier Wednesday, gave up three runs and six hits, striking out three in five innings.

Join our Newsletter for the latest news right to your inbox