It was the third time in the last four days Boston stormed back from a deficit of three runs or more, and Ramirez completed it by belting a 3-2 changeup by Tyler Clippard for a solo homer that snapped a 4-4 tie.
"We don't give up," said Ramirez. "We know what kind of players we are, what kind of team we got. We can come from behind. We just continue to play the game."
Heading into a four-game series in Baltimore that starts Monday, the first-place Red Sox lead the Orioles by three games in the American League East. The Blue Jays are four back.
And the Yankees, who came into the series four back, are all but out of the division picture, trailing by eight with 13 games to go. The Bombers are four back in the AL Wild Card standings, but would need to leap over four teams.
"I felt like we probably should have won three of those four, but they made the plays when they needed to," Mark Teixeira said. "They stepped up when they needed to, and it just didn't go our way."
Lefty CC Sabathia had tamed Boston early and rookie sensation Gary Sanchez hit his 16th home run as the Yankees took a 4-0 lead into the bottom of the fifth, but the scorching-hot Ramirez changed the complexion of the game with a two-out, three-run homer.
Jackie Bradley Jr. tied it with an RBI single to right in the sixth on what wound up being the final pitch of the game for Sabathia, who allowed four runs on eight hits over five-plus innings.
"Yeah, four-game series are difficult," said Red Sox manager John Farrell. "To take all four, and three of them in the comeback fashion, that says so much about that team down in the clubhouse. There's never any feeling of we're out of it. There's never any giving at-bats away."
Drew Pomeranz had a second straight abbreviated outing for Boston, lasting just 3 2/3 innings while giving up four runs on seven hits. The lefty has a 4.90 ERA in 12 starts since his trade to the Red Sox.
MOMENTS THAT MATTERED Hanley capitalizes on Yankees' mishap:Mookie Betts laced one back to the box, and Sabathia snared it out of the air on a nice play. Matter of fact, it looked like it was going to turn into an inning-ending double play. But Sabathia's throw to first was high for an error, as first baseman Billy Butler couldn't corral it. That allowed Ramirez to hit, and he crushed a three-run homer that sliced New York's lead to 4-3. According to Statcast™, Ramirez's liner that just cleared the Monster had an exit velocity of 109 mph and a projected distance of 392 feet.
"I was just listening from the dugout, 'Make them pay. Make them pay.' I've got to give a lot of credit to the guys on the bench," said Ramirez. "They are pushing hard to keep us in the game." More >
Sticking with CC: After Sabathia's errant toss opened the door for the Red Sox's three-run fifth inning, Yankees manager Joe Girardi sent the veteran back out for the sixth. Travis Shaw and Aaron Hill greeted Sabathia with singles, followed by Bradley, who lined Sabathia's 112th and final pitch into right field to tie the game, 4-4. It was Sabathia's second-highest pitch total of the season, surpassed only by the 116 he threw on June 16 at Minnesota.
"I knew we were short a little bit in the bullpen," Girardi said. "I didn't have [Luis Severino]. I didn't have [Adam] Warren. [Sabathia] had gotten those guys out, and he'd done a pretty good job. So we pushed him, and they had kind of a little dunker over the third baseman's head. It's unfortunate." More >
Betts robs Teixeira: With the Yankees trying to snap the tie in the bottom of the seventh, Teixeira laced a ball to right that seemed to have RBI double written all over it. But Betts raced toward the line and fully extended himself to make a tremendous diving catch. Betts fired to first and nearly doubled off Sanchez. The expected batting average on Teixeira's drive was .659, according to Statcast™. More >
Betts wasn't done. He robbed Brett Gardner of a hit leading off the ninth on a nearly identical play.
"I didn't even see Mookie. In my mind, I'm thinking, 'All right, that ball's in the corner, at the very least we've got second and third,'" Teixeira said. "And then he comes out of nowhere. He's a Gold Glove right fielder. He's that good. You saw. And he did it to Gardy also. That one hurts. You just don't get a break. It seems like, at the end of the game, these last four days we haven't gotten any breaks."
There's something about Gary: Sanchez has inserted himself in the AL Rookie of the Year discussion, and his 16th homer got out of Fenway in a hurry, clocked at 111.5 mph by Statcast™. The ball rocketed over the Green Monster before striking an advertising board and was Sanchez's hardest-hit homer of the season, as the 23-year-old catcher has now mashed five homers in his last 10 games. Sanchez also smoked a seventh-inning single off the wall and singled in the ninth.
AFTER FURTHER REVIEW In the fourth inning with nobody out, Mason Williams hit a deep fly ball against the Green Monster and Bradley retrieved it, quickly firing to second. The tag by Dustin Pedroia was late and Williams was called safe. The Red Sox challenged and after a one-minute and 54-second review, the call on the field was allowed to stand. Boston lost its challenge.
In the fifth inning, Bryan Holaday led off with a deep fly ball to left-center, bouncing against the top of the center field wall as the catcher stopped at second. After a 59-second crew-chief review to determine whether it was fan interference, the call was confirmed and Holaday remained at second with a double.
QUOTABLE "Electrifying. It seems that every at-bat he goes up there, everybody's watching, feeling like something is going to happen." -- Bradley, on Ramirez
SOUND SMART WITH YOUR FRIENDS According to Elias, the Red Sox became the first team to overcome three deficits of three runs or more in a single series since the Orioles did so on June 25-2 7, 2010, against the Nationals.
WHAT'S NEXT Yankees: Following their final off-day of the season on Monday, the Yankees open a three-game series on Tuesday against the Rays at Tropicana Field. Right-hander Michael Pineda (6-11, 4.94 ERA) gets the call after lasting just four innings in his most recent start. Left-hander Drew Smyly (7-11, 4.98) goes for the Rays, with first pitch scheduled for 7:10 p.m. ET.
Red Sox: Red-hot Rick Porcello (20-4, 3.12 ERA) opens up a pivotal four-game series at Camden Yards, which begins on Monday at 7:05 p.m. ET. Porcello lost, 1-0, on a homer by Mark Trumbo in his last start. The Orioles counter with right-hander Dylan Bundy (9-5, 3.88).