TORONTO -- The Boston Red Sox stumbled into Toronto mired in a four-game losing streak.
Thanks to some timely hitting from Mitch Moreland, they left Canada for a showdown in New York against the second-place Yankees riding high after a sweep of the struggling Blue Jays.
Moreland had a pinch-hit homer and drove in four runs, Hanley Ramirez added a solo blast and Boston beat Toronto 7-1 on Wednesday night.
"It's a testament to the guys in our clubhouse," manager John Farrell said of the turnaround after his team was outscored 38-10 over its skid. "They're driven, they're task-oriented, they don't dwell on what's happened previously. We felt like we needed to do that, coming off a tough series where we got swept at home."
Rick Porcello allowed one run in 6 2/3 innings as the AL East-leading Red Sox moved 5 1/2 games ahead of the Yankees, who were swept in a doubleheader by Cleveland. New York and Boston begin a four-game series at Yankee Stadium on Thursday.
"We definitely have a good feeling, obviously," Porcello said.
Ramirez connected for the second straight game as the Red Sox finished 8-1 in Toronto this season. Boston is 10-3 overall against the Blue Jays with six meetings remaining at Fenway Park in September.
Boston Red Sox
"They're in first place for a reason," Blue Jays left-hander J.A. Happ said of Boston. "They were tough this series."
Pinch-hitting for Chris Young against right-hander Tom Koehler (1-7), Moreland hit a second deck drive in the seventh, his 18th. It was the third pinch-hit homer of Moreland's career.
Moreland added a two-run single in Boston's four-run, bat-around eighth.
"Insurance runs are huge," Moreland said. "It just helps everybody settle in a little bit more."
Moreland is batting .346 (28 for 81) with 19 RBIs in his past 27 games.
"He's in a good place," Farrell said.
Ramirez also reached the second deck with his homer, a leadoff shot off Happ in the fifth.
"The last couple of nights, he's put some really good swings on some pitches," Farrell said.
The homers helped Porcello (9-15) finish August at 5-1 with an ERA of 4.04.
Toronto's only run came on a homer by Raffy Lopez in the third. The last-place Blue Jays lost for the 10th time in 12 games.
"Obviously it's been real tough," manager John Gibbons said. "We haven't played good enough baseball lately."
CRIME SPREE, PART 1
After Xander Bogaerts bluffed a steal from second in the eighth, Rafael Devers took off from first base, arriving ahead of the throw from catcher Lopez. Bogaerts made it to third when second baseman Rob Refsnyder's throw pulled Darwin Barney off the base. "(Bogaerts) kind of hung Devers out to dry a little bit," Farrell said. "The start and stop kind of puts us in a tough spot. Thankfully we were able to get out of it."
CRIME SPREE, PART 2
Boston went 11 for 11 in stolen base attempts in the series. The Red Sox have 24 steals against Toronto this season, the most by any team against an opponent.
Bogaerts drew a two-out walk in the third and Devers followed with a broken bat grounder to second. As Bogaerts ducked to avoid the jagged flying barrel, he was struck by the batted ball and ruled out.
Red Sox: LHP David Price (left elbow) threw a 20-pitch bullpen session Wednesday. Price had not thrown off a mound since July 22 against the Angels, when he allowed six runs in five innings. ... 2B Dustin Pedroia (left knee) ran the bases for a second straight day and remains on track to return during Boston's upcoming series with the Yankees. ... 3B Josh Rutledge had surgery on his left hip Tuesday and will miss the remainder of the season.
Blue Jays: 1B Justin Smoak (sore calf) was held out of the starting lineup, just the second time this season he has not played. ... 3B Josh Donaldson got the day off. ... 2B Devon Travis (right knee) suffered a setback in his rehab, decreasing the likelihood of a return this season. Travis has not played since June 4. ... SS Troy Tulowitzki said he has a "difficult rehab" ahead this winter as he recovers from torn ligaments in his right ankle. Tulowitzki will not return this season.
Red Sox: RHP Eduardo Rodriguez (4-4, 4.19) starts Thursday's series opener against the Yankees. Rodriguez is 4-1 with a 2.31 ERA in eight career starts against New York. LHP CC Sabathia (10-5, 3.82) starts for the Yankees.
Blue Jays: RHP Marco Estrada (6-8, 5.04) starts Thursday as Toronto begins a four-game series in Baltimore. Estrada is 1-0 with a 1.31 ERA in three starts against the Orioles. RHP Jeremy Hellickson (8-7, 4.88) starts for Baltimore.