That was rain that fell steadily from the sky Thursday night at Yankee Stadium, but it might as well have been champagne as the Yankees stopped their three-game losing streak with a 4-1 victory over the Red Sox and clinched their first postseason berth since 2012.

One more win in the three-game series that begins Friday night in Baltimore, or one loss by the Astros in their three-game series against the Diamondbacks, would clinch the first wild card and ensure that Tuesday night's American League wild-card playoff game is played at Yankee Stadium.

The clinching victory also marked the 10,000th win in club history, but more importantly, it allowed the Yankees to return to the playoffs in the first season without retired captain Derek Jeter.

"It's extremely gratifying with what we went through this year," manager Joe Girardi said. "These guys did it with heart and hard work. We had injuries and age, but they always fought back.

"The Yankees have always had great players. Derek Jeter was great for a long time and meant a lot to the franchise. We'll never forget what Derek did for the organization, but you have to move on."

Making the playoffs had a special significance to Alex Rodriguez, who has experienced a kind of renaissance at the age of 40 coming off a one-year suspension for PED use. Rodriguez said his only goal in spring training was simply to make the team.

advertisement | advertise on newsday

"This was probably the first year since I've been here in [2004] that we were underdogs,'' he said. "Years that we won 100 games, we were just playing to expectations. But this year, the last eight months, this team has come together."

One night after Yankees ace Masahiro Tanaka was cuffed around for four runs by the Red Sox, former ace CC Sabathia provided the first solid start of the series for the Yankees, allowing a run and six hits in five innings.

Adam Warren deserved half the decision for backing up Sabathia with three scoreless innings in which he allowed two baserunners. Dellin Betances got the save with a 1-2-3 ninth, striking out Josh Rutledge for the final out. It was the 589th strikeout by the Yankees' bullpen this season, tying the major-league record.

The game began in a soaking drizzle that ebbed gradually as the game went on. Fly balls didn't figure to carry, but Carlos Beltran led off the second inning by launching a full-count fastball from lefthander Rich Hill (2-1) to rightfield for his 19th home run.

Hill, who pitched for the Yankees last season and for the Ducks this year, allowed a one-out walk to John Ryan Murphy and a two-out walk to Didi Gregorius before allowing an RBI single by No. 9 hitter Brendan Ryan for a 2-0 lead.

Yankees videos

It was the ninth time Beltran put the Yankees ahead with a home run. After a poor April, he has a .292/.352/.505 slash line with 19 homers and 59 RBIs in his last 113 games.

"It's a great feeling being able to accomplish this," he said in the joyful clubhouse. "I was able to find my swing and be consistent over the second half. A lot of guys stepped up. Our bullpen has been great . . . Our mentality is to go as far as we can."

Sabathia labored into the fifth, when he gave up an RBI single by Mookie Betts that trimmed the Yankees' lead to 2-1. He was done after 96 pitches.

Jean Machi allowed Greg Bird's one-out homer into the Yankees' bullpen -- his 11th of the year -- in the seventh for a 3-1 lead. In the eighth, Rob Refsnyder hit Heath Hembree's first pitch into the Red Sox bullpen, and the Yankees' return to the playoffs was virtually assured.

Asked if he appreciates the experience even more this season, Rodriguez said, "Boy, is that an understatement. With all the stuff that I went through in '14, I talked about how dark those days were. To come back this year and be part of such a special team, such special guys, we truly are a family, and we've built a great brotherhood in here.

advertisement | advertise on newsday

"You're in the dance, and anything can happen . . . I like our chances."