ST. PETERSBURG, Fla. (AP) Every win these days is extra special for the playoff-contending Tampa Bay Rays.

Nate Lowe hit a two-run homer in the 11th inning and the Rays beat the Boston Red Sox 5-4 on Saturday night to move one game ahead of Cleveland for the second AL wild card.

Tampa Bay won its third straight game, all in 11 innings.

"You look at teams that go down to the wire like we're doing, you have to have some fortunate things go your way," Rays manager Kevin Cash said.

A day after the defending World Series champion Red Sox were mathematically eliminated, Mitch Moreland put Boston ahead 4-3 with a two-out homer in the 11th off Diego Castillo (5-8).

"That just shows the type of season that we're having," Boston third baseman Rafael Devers said through a translator. "Last year we had a great season, winning these ballgames and now this year we're on the other end of it. It's been tough but we're still giving 100 percent every single day trying to win these ballgames because that's what we're here to do."

Travis d'Arnaud doubled off Josh Smith (0-3) in the bottom half, and Lowe sent an opposite-field drive down the left-field line.

"There's not a whole lot that's better than hitting a walkoff homer in a pennant race," Lowe said.

Boston's J.D. Martinez 0 for 5 with four strikeouts as a designated hitter after missing three games with left groin tightness.

D'Arnaud and Joey Wendle had run-scoring singles as the Rays took a 2-0 lead in the third, and Willy Adames put the Rays ahead 3-1 with a long homer off Josh Taylor in the seventh.

Devers hit a two-run homer off Nick Anderson that tied it 3-all in the eighth. He has 31 homers, breaking a tie with Butch Hobson (1977) for the most by a Red Sox third baseman.

"This is actually the first time I'm hearing of this," Devers said. "It's pretty cool.

Rays starter Yonny Chirinos, reinstated from the 10-day injured list after being sidelined since Aug. 5 by right middle finger inflammation, entered in the fourth and allowed Bogaerts' leadoff homer.

Bogaerts has a career-high 32 homers and 110 RBIs. He got his 51st double during the first.

Tyler Glasnow made his third start for the Rays after missing four months with a strained right forearm. He struck out seven in three scoreless innings.

"This is definitely one of the more memorable wins for us," Glasnow said.

"Eleven's our lucky number," d'Arnaud added.

BUSY BULLPENS

Boston used 11 pitchers on a bullpen day. With Glasnow on a pitch count of around 50, the Rays used nine pitchers.

FULL CLUBHOUSE

With the addition of Chirinos, the Rays now have a team record 39 active players. This is the last season that a team can expand to any number from the 40-man roster in September. Next year teams will carry 28 players during the month.

NUMBERS

Tampa Bay (92-63) is 29 games over .500 for the first time since ending the 2010 season at 96-66. ... The Rays have won six in a row over Boston to tie their longest winning streak against the Red Sox. The other six-game run came in 2011.

TRAINER'S ROOM

Red Sox: LF Andrew Benintendi (jammed left thumb) pinch ran in the ninth. ... RHP Heath Hembree, out since Aug. 2 with right elbow inflammation, will likely be opener in a game during the season's final week.

Rays: All-Star 2B Brandon Lowe (bruised right shin and strained left quadriceps) played four innings in an instructional league game. ... OF Avisail Garcia, who left after six innings Friday with dizziness, felt better but didn't play.