ST. PETERSBURG, Fla. - For six innings Tuesday night Nathan Eovaldi pitched as well as any Yankee has this season, completely dominating the overmatched Rays.

It changed quickly.

Tampa scratched out two runs to tie it in the seventh, then pushed across two more in the eighth as the Yankees lost, 4-2, to the Rays in front of 10,417 at Tropicana Field.

Eovaldi (3-1) entered the seventh with a 2-0 lead and having thrown only 70 pitches but left without both the lead and the low pitch count after a 21-pitch frame.

Evan Longoria, who brought in the eventual go-ahead run in the eighth with a sacrifice fly against Dellin Betances, led off the seventh with a broken-bat single to left. James Loney followed with a ground smash that a diving Garrett Jones knocked down at first and flipped to Eovaldi for the out. Eovaldi walked Logan Forsythe and threw a wild pitch that moved the runners up a base. David DeJesus got ahead 2-and-1 before hitting a slider up the middle for a two-run single that tied it at 2-2.

Eovaldi struck out Rene Rivera to start the eighth inning but walked Kevin Kiermaier. Steven Souza Jr. then hit a soft liner on an 0-and-1, 95-mph fastball to right for a single, putting runners at the corners with one out.

Joe Girardi called on Betances to face Longoria, who came out aggressive, swinging first pitch at a 95-mph fastball and lofting it to center, plenty deep enough to bring in Kiermaier for a 3-2 lead.

A stolen base and consecutive wild pitches by Betances brought in Souza to make it 4-2.

The Yankees (21-13) scored twice against Chris Archer in a 32-pitch first, though that would be all they would get against the righthander.

Leadoff man Jacoby Ellsbury improved to 11-for-16 in his career against Archer with a single and Brett Gardner followed with an opposite-field single to left. Alex Rodriguez worked a walk to load the bases and Brian McCann lined a 1-and-1 fastball, which came in at 95 mph but flat, to right for an RBI single that made it 1-0. Carlos Beltran made it 14 hits in his last 39 at-bats with a single to right that brought in Gardner to make it 2-0.

With the bases loaded, Archer did well to prevent further damage by striking out Chase Headley, getting Stephen Drew to fly out and Jones to ground out.

Eovaldi allowed a squib infield single to Souza with one out in the first but struck out Longoria looking at a 97-mph fastball on the corner and picked Souza off first to end the nine-pitch inning.

Ellsbury and Gardner hit back-to-back singles with one out in the second but both were caught stealing on laser throws by Rivera to end the inning.

After Souza's infield single, Eovaldi retired 11 straight -- he was at only 38 pitches through four innings -- before Forsythe snapped the streak with a one-out chopper to third in the fifth for another infield single. DeJesus followed with a soft liner over the head of shortstop Didi Gregorius. Asdrubal Cabrera grounded out to put runners at the corners with two outs, but Eovaldi kept the shutout intact by striking out Brandon Guyer swinging at a 94-mph fastball.