Alex Rodriguez #13 of the New York Yankees celebrates with...

Alex Rodriguez #13 of the New York Yankees celebrates with teammate Stephen Drew #14 as his makes his way to the dugout after scoring off of an RBI single to centerfield by Chase Headley #12 during the third inning of a game against the Tampa Bay Rays on April 19, 2015 at Tropicana Field in St. Petersburg, Fla. Credit: Getty Images / Brian Blanco

The Yankees left Baltimore late Wednesday looking every bit the last-place team they were.

"We need to turn it around,'' Joe Girardi said that night. "We need to start winning series or it becomes a long year.''

It still is too early to determine which way that will go, but for at least one series, there was a turnaround.

Neither Michael Pineda nor his offense was dominant, but both did enough for the Yankees to complete a three-game sweep of the Rays with a 5-3 victory Sunday in front of 21,791 at Tropicana Field.

"There was no panic,'' said Chase Headley, who had two of the Yankees' 11 hits, drove in two runs and made two good stops at third. "It was more of let's just right this ship as soon as possible.''

The Yankees (6-6), who arrived here 3-6, did so just in time. They continue a three-city, 10-game trip Monday night against the AL Central-leading Tigers (10-2), a significant step up in competition from the young Rays (6-7).

"It's nice,'' said Andrew Miller, who pitched a scoreless ninth to go 4-for-4 in save chances. "We've kind of been grinding through series and hadn't been able to win one yet, so to get a sweep is nice. Detroit's a really good team, they're playing really well, but it's nice to have some momentum.''

Pineda (2-0, 5.00) allowed three runs -- two on Steven Souza Jr.'s first-inning homer -- seven hits and a walk in 52/3 innings. The righthander struck out five.

"Today I didn't have my best stuff,'' said Pineda, who thought his changeup and slider, the pitch Souza hit out, in particular were subpar. "I tried to make adjustments and stay in the game, try to hold the game and give my team a chance to win.''

He turned over a 5-3 lead to the bullpen, and Chris Martin, Justin Wilson, Dellin Betances (12/3 innings) and Miller kept the score that way. The lefthanded Miller allowed a leadoff double to righthanded-hitting Ryan Brett in the ninth but struck out Rene Rivera, Logan Forsythe and Souza to end it.

"It's not how I wanted to start,'' Miller said. "Right there, it's about getting three outs before they get two runs, and fortunately I was able to do that. It wasn't pretty but I got there.''

Garrett Jones, who got the start in rightfield, contributed three hits and Jacoby Ellsbury added two. Alex Rodriguez remained at 658 homers but walked twice, doubled and scored twice. Mark Teixeira added two RBIs.

"It definitely was a big series for us,'' said Jones, who tripled and scored on John Ryan Murphy's sacrifice fly in the fourth to make it 4-2. "Bats are starting to come alive, we're having good at-bats, we're scoring runs for our pitchers, taking a load off of them. Today was a good overall win. We want to continue building on that.''

Girardi took note that the Yankees got the leadoff man aboard in each of the first seven innings. "We felt that we were going to have a pretty good offense,'' he said.

Of finally winning a series, Girardi said: "It feels good. You're getting contributions up and down the lineup. Our bullpen came in and did a really good job, we got some good starting pitching. Those are the things you need to be consistent. We're going to play a team that's playing very well and we have our work cut out for us.''

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME