A pair of walks and a fielding error later, he was facing Boston slugger David Ortiz with two outs and the bases loaded while protecting a three-run lead.
"The hitter he had to get out who has so many times beat the Yankees and has had big hits for them," Yankees manager Joe Girardi said on Sunday night. "It shows he has the stomach for it."
Miller got Ortiz on a hard line drive right to center, and the Yankees completed the three-game sweep of the rival Red Sox with an 8-5 victory. It was New York's first sweep of a Red Sox series three games or longer since a five-game sweep in 2006.
"There's still a long way to go, but you can't feel any better than that," said Miller, who saw Ortiz win plenty of games as a Boston teammate from 2011-14. "He's got a flare for the dramatic. That's been the most important part of his career. It's not how I drew it up and wanted to do it."
Jacoby Ellsbury had four hits and was also hit by a pitch and walked to reach base a career-high six times. Mark Teixeira and Brett Gardner homered for the Yankees, who have won 13 of 16 games since starting the season 3-6.
Adam Warren (2-1) took a one-hit shutout into the sixth inning, allowing four runs in 5 2/3 innings. New York opened an 8-0 lead and then held on after Boston scored five runs and brought the tying run to the plate in the sixth.
The Red Sox didn't really threaten again until the ninth. It was still 8-5 when Miller came in, striking out two and walking two before third baseman Chase Headley struggled to field Dustin Pedroia's grounder, loading the bases. Ortiz fell behind 0-2 before hitting a 2-2 pitch hard, but right at Ellsbury.
"I think we showed tremendous fight, tremendous comeback," Red Sox manager John Farrell said, "right down to the final swing of the night."
The Red Sox lost for the eighth time in 11 games to fall below .500 for the first time this season. Mike Napoli hit a three-run homer in the sixth, the only inning Boston scored.
Teixeira's two-run homer gave New York the lead in the first. The Yankees made it 5-0 against Joe Kelly (1-1) in the third on back-to-back doubles by Brian McCann and Carlos Beltran. And they took an 8-0 lead in the sixth on Gardner's three-run homer.
Warren, who didn't allow his first hit until Mookie Betts doubled to lead off the fourth, still had a one-hit shutout with two out in the sixth. But he gave up a single to Pedroia and an RBI double to Ortiz before hitting Hanley Ramirez with a pitch. Pablo Sandoval followed with an RBI single to left.
Esmil Rogers relieved Warren and Napoli hit his second pitch into the first row of the Monster Seats. Daniel Nava walked and Xander Bogaerts singled before Blake Swihart, who made his major-league debut on Saturday, struck out to end the inning.
Ramirez threw his bat aside and motioned angrily after being hit by the pitch. But even Red Sox manager John Farrell said he didn't think Warren was trying to hit Ramirez. After Ellsbury was plunked in the eighth, the umpires warned both benches.
"It seemed a little fishy to me," Yankees manager Joe Girardi said.
Alex Rodriguez did not homer, leaving him tied with Willie Mays on the all-time list with 660. ... The last time the Yankees swept the Red Sox in three or more games was Aug. 18-21, 2006. New York has won four straight series at Fenway Park. ... Boston RHP Dalier Hinojosa made his major league debut. ... The game drew 33,198. Two of the three games in the series did not sell out. ... Ortiz reached safely in all 12 home games. ... Kelly allowed five earned runs for the third straight game. ... Batters are 3-for-43 this season against Miller. He joined Tippy Martinez as the only pitchers in Yankees history to convert their first 10 save opportunities.
Yankees: INF Brendan Ryan re-injured his hamstring while running in Florida during a rehab assignment. He is expected to rest for at least a week.
Red Sox: Clay Buchholz (1-3) will pitch the opener of a three-game series at home against Tampa Bay and try to earn his first win since pitching seven shutout innings on opening day. Jake Odorizzi (2-2) will pitch for the Rays.
Los Angeles Dodgers to retire Gil Hodges' No. 14 jersey in June
Gil Hodges, who helped the Dodgers win World Series titles in Brooklyn and Los Angeles, will have his No. 14 jersey retired.
Fantasy Baseball Forecaster for Week 8 - May 30 to June 5
Set your lineups for the week ahead in fantasy baseball with our forecaster preview, which features pitcher rankings, two-start pitchers, hitter ratings, schedule observations and more.
Colorado Rockies unveil City Connect uniforms
Welcome to Colorful Colorado, indeed. The Rockies are keeping it on brand with hints of pine trees, skiing and sunshine for their City Connect uniforms.
Ranking MLB's City Connect uniforms
From the Sugar Kings to the Serpientes, the South Side to Space City, we break down the best and worst of baseball's latest fashion trend.
Latest NFTs from the sports world - Magic Johnson with Top Shot, Wayne Gretzky partners with eBay and the return of Mars Blackmon
A couple of NBA legends get in on the craze, Wayne Gretzky kicks off a new collection and Spike Lee makes a return in the latest NFT ventures from the sports world.
Stephen A. reacts to Josh Donaldson's apology for 'Jackie' remark
Stephen A. Smith comments on Josh Donaldson's apology to Jackie Robinson's wife and family for 'Jackie' remark to Tim Anderson.