NEW YORK — Michael Pineda was hit hard at the start, and the New York Yankees’ playoff push was delayed once again by their longtime rivals when the Boston Red Sox got two homers and five RBIs from rookie catcher Blake Swihart in a 10-4 victory Tuesday night.

Rick Porcello (9-14) recovered neatly from a rocky first inning, and the Red Sox won their season-best fifth straight game to pass the Orioles for third place in the AL East.

New York is running second in the division and was spared the possibility of the Blue Jays clinching the crown when they were rained out in Baltimore. Toronto will play a doubleheader Wednesday against the Orioles and needs only one win – or another Yankees loss – to wrap up its first AL East title in 22 years.

Pineda (12-9) and the Yankees began the day looking to lock up at least a wild card, but that chance was washed away when Minnesota was rained out in Cleveland. New York needs two wins in its final five games – or some help – to reach the postseason for the first time since 2012.

Pineda was 3-0 with a 3.14 ERA in his previous five outings and had pitched very well against Boston since joining the Yankees. But he gave up hits to three of his first four batters as the Red Sox scored six runs in the first inning for the first time at Yankee Stadium.

Brock Holt hustled for an RBI double and Swihart capped the outburst with a three-run homer to the short porch in right field. Pineda bent over at the waist and shook his head, just moments before Chris Martin started to get loose in the bullpen.

New York responded with four runs off Porcello in the bottom half, including an RBI double by Carlos Beltran and a two-run homer by Dustin Ackley. But the right-hander settled in from there and did not allow any more damage, throwing 118 pitches in eight innings.

Jacoby Ellsbury made a bid for a go-ahead, three-run homer in the fourth but the ball was caught at the right-field fence.

Mookie Betts homered on Pineda’s first pitch in the fifth, and Swihart added a two-run drive off Bryan Mitchell in the eighth.

It was the first multihomer game for Swihart, who entered with three long balls this season. He topped his previous career best of three RBIs.