ST. PETERSBURG, Fla. – Tampa Bay Rays Manager Joe Maddon knows that even after a much-needed victory, his team still has an uphill battle to make the AL playoffs.

Desmond Jennings hit a two-run triple in Tampa Bay’s seven-run sixth-inning Wednesday night, and the Rays snapped a four-game losing streak by beating the Boston Red Sox, 13-3.

The Red Sox (68-82) are assured of their first losing season since 1997.

Despite the win, Tampa Bay fell 6½ games behind the AL East-leading New York Yankees, who swept a day-night doubleheader against Toronto. The Rays started play six games back in the AL wild-card race.

“We want to do a little of Minnesota Fats got to run the table,” Maddon said. “We’ve got to believe we can do it. We have to get really hot. We have no alternative. The standings are very difficult but we are alive and kicking.”

Jennings also scored following his triple against reliever Alfredo Aceves when the throw from the outfield eluded third baseman Pedro Ciriaco.

Four Boston pitchers walked six in the sixth, including walks to Carlos Pena and Jose Molina with the bases loaded. Luke Scott had a sacrifice fly and Jeff Keppinger added an RBI single.

“Walks are the killer bee,” Red Sox Manager Bobby Valentine said.

Keppinger hit a solo homer and Pena added a two-shot off Daisuke Matsuzaka (1-6) as Tampa Bay went ahead 5-3 in the fourth.

Chris Archer (1-3) allowed three runs and five hits in five innings for the Rays, who won for the second time in nine games. It was the rookie’s first major league win.

“It feels pretty good,” Archer said. “This is a classic example of keep the team in the game for as long as you can and they’ll pull it out for you. I think it was big all around tonight. It’s hard not to be selfish but as a team it’s awesome that we got the win, and for it to be my first one, that’s pretty amazing, too.”

Boston took a 3-1 lead in the third on Jacoby Ellsbury’s run-scoring single and an RBI grounder by Dustin Pedroia. Ellsbury has 10 RBI in his last 11 games.

Ben Zobrist, who drove in four runs in the Rays’ 7-5 loss to Boston on Tuesday, cut the deficit to 3-2 with an RBI single later in the third.

Tampa Bay loaded the bases with no outs in the second on singles by Evan Longoria, Scott and Keppinger. The Rays scored just once to make it 1-1 when Matt Joyce followed with a walk. Matsuzaka avoided further damage by striking out Pena and getting a double-play grounder from Molina.

Joyce also had an eighth-inning RBI single.

Matsuzaka gave up five runs and nine hits in three-plus innings. He’s 2-8 in 14 starts against Tampa Bay.

“After the first inning, I kept throwing it where they wanted the ball and they never miss those pitches. It really hurt me,” Matsuzaka said through an interpreter. “As always I’m disappointed in myself for not helping my team out. It’s been really hard to keep the positive going so far.”

Valentine didn’t directly answer a question about whether Matsuzaka will start again.

“We’ll see what he’s feeling like (Thursday),” Valentine said. “Maybe a little more rest is what’s needed at this time of year.”