KANSAS CITY, Mo. -

Michael Pineda kept throwing strikes. The Royals kept taking them, trying in vain to drive his pitch count up. When Yankees catcher Brian McCann looked up in the third inning, his right-hander had still thrown just 35 pitches.

He knew then that Pineda was in a groove.

Pineda wound up pitching into the seventh inning Monday night to win for the first time since April 16, helping New York beat the Kansas City Royals 8-1 for its fifth straight win.

"He's got so much cut on his fastball," McCann said. "I feel like he could literally throw it every pitch and be successful. When he's like that, he's as good as anybody."

In the makeup of a game rained out in early June, Pineda (3-2) gave up a solo shot to Mike Moustakas leading off the third inning. But that was about it in Pineda's third game back from the disabled list. He struck out five without a walk.

Jacoby Ellsbury drove in a run in the seventh inning with the 1,000th hit of his career, then added a two-run homer in the ninth. Derek Jeter added a pair of RBIs in his final scheduled trip to Kauffman Stadium, and Stephen Drew and Martin Prado had solo home runs.

"It's nice when you have a lot of people contribute," Yankees manager Joe Girardi said.

James Shields (12-7) allowed six runs over 6 2-3 innings for Kansas City.

"We've been playing really, really good baseball the last month or so. We're definitely not going to let just one little game take care of us," Shields said. "We're going to move onto this next series and hopefully we'll win it."

If you're willing to count the makeup against New York as a true series, it was the first time in their last 11 that the Royals have dropped one.

"It's going to happen," outfielder Alex Gordon said. "We'll bounce back. We'll be OK."

Jeter, who is retiring after the season, answered a standing ovation as he stepped to the plate in the third inning with a groundout to shortstop that gave New York a 1-0 lead.

Moustakas tied the game with his 15th homer in the bottom half.

Drew gave the Yankees the lead back in the fourth with his home run, and they piled on four more runs off Shields in the seventh to put things out of reach.

The last of the runs was scored by Ellsbury, who came home on a sacrifice fly by McCann. Ellsbury initially was ruled out at the plate, but the call was overturned after a 2-minute video review showed his left leg sliding just under catcher Salvador Perez's tag.

That was plenty of support for Pineda, who had gone through the ringer since his previous win. He served a 10-game suspension for getting caught with pine tar on his neck in a game against Boston, then landed on the DL with shoulder trouble that kept him out until mid-August.

Pineda was stuck with a pair of no-decisions in his first two starts back.

"I feel pretty good," he said. "I feel like I have good power in my arm."

BRONX BOMBERS

The Yankees homered at least three times in a game for the seventh time this season, but it was the first time they had done it since July 9 at Cleveland.

CRACKED SHIELDS

Speaking of homers, Shields gave up at least two in a game for the seventh time this season, tied for second-most in the majors behind the Brewers' Marco Estrada with nine.

GORDO'S GRAND

Gordon played in his 1,000th game for the Royals, making the 30-year-old outfielder the 10th player in franchise history to reach the milestone.

TRAINER'S ROOM