It might be way too early to call the Pittsburgh Pirates a team of destiny. But after what manager Clint Hurdle witnessed Thursday night, he had to stop and wonder.

"Sometimes, you're just meant to win," he said.

The Pirates got a lucky break when Boston pinch-runner Jemile Weeks was hit by a batted ball in the ninth inning, beating the Red Sox 3-2 to keep pace in the NL pennant race.

The Pirates won their fourth in a row. They began the day 2 1/2 games ahead of Milwaukee for the second wild-card spot, and host the Brewers in a three-game series beginning Friday night.

Down 3-2, the Red Sox put runners at the corners with no outs in the ninth against Mark Melancon. Will Middlebrooks then hit a chopper down the line and ball struck the back of Weeks' left leg as he made a dive back to third.

Weeks was called out, and Melancon retired the last two batters for his 30th save in 34 opportunities.

"I've never seen that one before," Hurdle said.

Weeks said there was nothing he could have done to avoid being hit by the ball.

"There was a lot involved," he said. "The play was, if it's not a double-play ball, make sure you get back. It wasn't a double-play ball, got back, had to avoid getting tagged or creating a double-play situation. That's what I did and the ball hit me on the way back."

Gerrit Cole (10-5) allowed two runs in seven-plus innings, striking out seven and walking none. He won his season-best third straight start.

The second-year righty improved 7-1 in nine career September starts.

"Pitching like games like this is fun," Cole said. "Every game I've pitched (in September) has been do-or-die. You want the ball in that situation. You want to do well."

Starling Marte hit his 13th homer, connecting off Brandon Workman (1-10) in the fifth for a 3-1 lead. Workman lost his 10th straight decision.

Boston had closed to 3-2 in the eighth on Xander Bogaerts' sacrifice fly, but lost for the eighth time in its last 11 games. Cole was lifted after giving up back-to-back singles to Christian Vazquez and Garin Cecchini to start the inning.

TRAINER'S ROOM

Red Sox: INF-OF Brock Holt, who has not played since Sept. 5 because of a concussion, was cleared to resume baseball activities Thursday after being examined by Pittsburgh-based head trauma specialist Micky Collins. Boston is hopeful Holt can play in a few games before the season ends Sept. 28. If not, he will go for the Florida Instructional League camp in Fort Myers to get some game action.

Pirates: SS Jordy Mercer was back in the lineup after missing two games with a lower back strain and went 1 for 3 with a double.

UP NEXT

Red Sox: RHP Allen Webster (4-3, 6.02) will start Friday night in the opener of a three-game series at Baltimore, facing RHP Kevin Gausman (7-7, 3.57).

Pirates: LHP Jeff Locke (7-5, 3.66) will face the Brewers' Yovani Gallardo (8-10, 3.59) in the series opener.

BIG PAPI RETURNS

Boston designated hitter David Ortiz returned to the team and started at first base after missing the first two games of the series because of a family emergency. Ortiz was forced to play in the field because the DH rule is not in effect in interleague games at NL parks. He went 0 for 4 and struck out twice.