TORONTO -- Jeff Niemann could not keep the Rays' run of seven-inning starts alive on Saturday.
But more important is that he did get the win as the Rays, bolstered by a big homer from B.J. Upton, beat the Blue Jays, 6-5, before 24,052 at Rogers Centre.
The Rays, who withstood two eighth-inning homers from Toronto, are an American League-best 19-9 since July 28.
The streak of 11 consecutive starts of at least seven innings by Rays starters ended when the right-hander was lifted for left-hander J.P. Howell after 6 1/3 innings after the Blue Jays scored their third run.
"I didn't know that," Niemann said. "I knew we had been doing well, but I didn't know it was like that."
The streak was longest of any team since the Mariners also had a run of 11 consecutive starts of at least seven innings from June 11-23, 2003.
Niemann (9-5) held the Blue Jays to five hits, two walks and three runs while striking out six.
"Not great but good," manager Joe Maddon said. "He got through it. He started out slowly. I thought he settled in well and I thought eventually at the end there you could see that he got tired."
Closer Kyle Farnsworth was not available to pitch because of a tender elbow, so Joel Peralta came in for the ninth to pick up his second save of the season, overcoming a dropped foul by catcher Kelly Shoppach.
"He was day to day, and I feel in talking to him he will probably be available [Sunday]," Maddon said of Farnsworth.
The Rays went ahead to stay on a single by Elliot Johnson against reliever Shawn Camp (1-3) to take a 3-2 lead in the sixth. And Upton hit his 18th homer of the season with two on against Jesse Litsch in the seventh to push the Rays into a four-run lead.
It came an inning after he had hit a long foul to left that prompted an umpire's review that it was indeed foul.
"The foul pole's so light you can't really tell whether it went around it or before it," Upton said. "I think Joe said the same thing. I'm not worried about it once they said it was foul. I didn't know. I wasn't sure. It hooked really hard late, so I didn't think it hurt to check it out."
"I couldn't tell," Maddon said "It was hit so far and it was fair for a long ways and then it hooks at the very end and that foul pole is up. It's not like back against the stands.
"It's up with the fences. So it's kind of a depth perception problem where it's hard to gauge if the ball actually went around it. I didn't disbelieve the umpires, but it was so far I thought it was worth looking at. They did the right thing. I appreciate what they did."
And the one in the seventh? "I guess it was fair," Upton said. "It was just something he left over the plate. In that situation I wasn't trying to do too much -- just take what he gives me. I got extended on it."
"I congratulated him on keeping that ball fair," Maddon said.
The Blue Jays scored in the first when Jose Bautista doubled in Eric Thames. It might have been worse for the Rays. Adam Lind lined a ball off the right-field wall that bounced back to Sam Fuld, who held Lind to a single. Bautista was guilty of poor baserunning and pulled into third. Niemann retired the next two batters to minimize the damage.
Evan Longoria led off the fourth with a walk and moved to third on Ben Zobrist's Major League-leading 43rd double, over the head of center fielder Dewayne Wise. After Upton struck out, Sean Rodriguez doubled on a 3-0 pitch to give the Rays a 2-1 lead.
The Blue Jays tied the score in the fourth. Edwin Encarnacion led off with a walk. Kelly Johnson grounded to first. Rodriguez stepped on first for the out and his throw was in time to get Encarnacion, but shortstop Reid Brignac had the ball pop out of his glove. J.P. Arencibia then doubled in the tying run.
The Rays loaded the bases with two out in the fifth, but Toronto starter Luis Perez struck out Zobrist with his final pitch of the day.
The Rays took the lead in the sixth. Upton was hit by a pitch after his reviewed foul ball and Rodriguez singled. Shoppach bunted, and it nearly resulted in a triple play. Camp fielded the bunt for the force at third and the throw to first completed the double play. Second baseman Kelly Johnson then threw back to third baseman Brett Lawrie, but Rodriguez slid in safely. Elliot Johnson then delivered the go-ahead single.
In the seventh, Fuld and Longoria took one-out walks from Litsch to set up the situation for Upton, who hit the first-pitch cutter into the second deck. The Blue Jays scored in the seventh on a triple by Lawrie and a groundout by Arencibia to end Niemann's.
"The pitch to Lawrie he definitely didn't want to elevate in that moment, but he did," Maddon said. "That was a big out to get Arencibia to bounce out to the shortstop. He was not as sharp as he can be but nevertheless a great job."
"I was feeling pretty good but with the long inning [in the seventh] I tried to stay loose, tried to stay warm," Niemann said. "But I went out there and it wasn't quite the same. It was all right, just took me a few to get going."
"I think with those pitching changes late, that was quite a long inning for a big guy going out there sitting down for that long," Shoppach said. "He came back and got a big out, but it looked like he was gassed."
Eric Thames hit his ninth homer of the season, against left-hander Jake McGee, to open the eighth and Encarnacion hit his 14th homer with two outs, against Juan Cruz.
The Blue Jays were without manager John Farrell for the second game in a row. He was resting at home after being diagnosed with pneumonia.
Larry Millson is a contributor to MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.