TORONTO – Jonathan Papelbon’s streak of perfection against the Blue Jays came to a costly end for the Boston Red Sox.

Fred Lewis’ sacrifice fly capped a four-run rally in the ninth inning and lifted Toronto to a 6-5 victory over Boston on Thursday, just the Blue Jays’ third win in 12 games against the Red Sox this season.

“He’s always shut the door on us,” Toronto’s Aaron Hill, who scored the winning run, said of Papelbon. “It’s nice to get a guy like that.”

The blown save, Papelbon’s first in 25 career chances against Toronto, denied the Boston right-hander his 30th save. He needs one more to become the first pitcher ever to begin his career with five straight 30-save seasons.

Trailing 5-2, Toronto’s Jose Bautista chased starter John Lackey by leading off the ninth with his major league-leading 36th homer.

“Once again, there’s Bautista,” Blue Jays Manager Cito Gaston said. “He got us going.”

Papelbon (4-5) came on and blew his sixth save of the season.

“It seemed like every one of my pitches today was up in the zone,” Papelbon said. “In a pressure situation, obviously, that can’t happen.”

Papelbon said he felt “groggy” all afternoon, both in the bullpen and on the mound.

“I didn’t have much power or energy in my delivery today,” Papelbon said.

Vernon Wells greeted Papelbon with a double and scored when Adam Lind lined a single up the middle. Pinch-runner Dewayne Wise stole second and moved to third when Hill singled off Papelbon’s left foot.

“It seemed like it hurt a little bit,” catcher Jarrod Saltalamacchia said. “He needed a second.”

Papelbon stayed in the game and struck out Travis Snider, but Encarnacion tied it with a double down the line in left. Pinch-hitter Lyle Overbay was walked intentionally to load the bases for Lewis, who hit a fly ball to shallow center off Daniel Bard. Hill tagged up and slid home well ahead of the throw from Jacoby Ellsbury.

“It was down and in,” Bard said of his pitch to Lewis. “He probably grounds it out half the time. It was definitely where I wanted it. He did a good job getting under it.”

Kevin Gregg (1-4) pitched one inning for the win.

The Red Sox, who are four games behind Tampa Bay in the American League wild-card race, open a three-game series in Texas today and will have to put the defeat behind them quickly.

“Whether we can or not, we’re going to have to,” infielder Jed Lowrie said. “We don’t have a choice at this point.”

David Ortiz and Lowrie hit solo homers for the Red Sox, who had won 10 of their previous 11 in Toronto.

Lackey had thrown only 98 pitches when Manager Terry Francona came out to replace him, but he wasn’t about to question the decision to got to Papelbon.

“I still felt pretty strong, but we’ve got a great closer so it’s tough to argue,” Lackey said.

Lowrie and Ortiz both hit solo shots in the fifth, giving Boston eight homers in the series and 155 this season. Only Toronto (179) has hit more.

Ortiz’s homer was his 25th of the season, the seventh time in his Red Sox career he’s reached the plateau. Only Ted Williams (14) and Jim Rice (7) have had as many 25-homer seasons with Boston.

Lowrie’s homer was his first since a grand slam against Cleveland last Oct. 4.

The Red Sox opened the scoring with two run in the third when Victor Martinez hit a sacrifice fly and Ortiz followed with an RBI single.

Toronto cut the deficit in half in the fourth when Bautista scored on Lind’s double-play grounder.