Brantley delivered the go-ahead home run off Yankees reliever Chad Green leading off the bottom of the eighth with the score tied at 2, and Ramirez manufactured an insurance run when he singled, stole second and advanced to third on a throwing error. He later scored on Yan Gomes' sacrifice fly to right.
Yankees right fielder Giancarlo Stanton made a strong throw to the plate, but Ramirez beat catcher Kyle Higashioka's tag with a head-first slide. Pinch runner Erik Gonzalez trotted home on a wild pitch by Green for a three-run advantage.
"I got a pitch out over the plate, put a good swing on it and was lucky to give us the lead," Brantley said of his go-ahead homer. "The guys behind me did a great job putting quality at-bats together and scoring an extra couple of runs."
Brantley's home run was his 12th of the season and first since June 11, giving him 56 RBI. Ramirez, meanwhile, became the first Indians hitter with at least 20 home runs and 20 stolen bases before the All-Star break since Grady Sizemore in 2008.
Manager Terry Francona said he's not supposed to run out of superlatives for players like Ramirez, so he noted the All-Star's hustle was an indicator of his passion for the game.
"He's a great player and he's a great teammate who cares about winning, almost desperately," Francona said. "That's a pretty good combination to be all balled up into a 5-foot-9 third baseman."
Cody Allen struck out a pair and got Neil Walker to pop out in the ninth for his 20th save.
Trevor Bauer (8-6, 2.24) pitched seven innings and allowed a pair of runs on seven hits with a walk and seven strikeouts. He ranks third in the American League with 175 punchouts trailing Boston's Chris Sale and Houston's Gerritt Cole.
Bauer surrendered an RBI single to Yankees center fielder Aaron Hicks in the third inning and a solo home run to second baseman Neil Walker in the fourth. It was the eighth time Bauer has pitched at least six innings and allowed fewer than three runs but failed to get a win.
After giving up singles to Stanton and Aaron Judge in the first inning, Bauer settled in and made an adjustment to the heart of New York's order.
"Don't throw fastballs," Bauer said. "Judge hit the first one. I made an adjustment, starting throwing them more breaking stuff until they make an adjustment back, that's kind of what I stuck with."
Carlos Carrasco relieved Bauer in the eighth inning and picked up his 11th victory. It was Carrasco's first relief appearance since Aug. 5, 2014 against Cincinnati at Progressive Field. He made 114 consecutive starts for Cleveland between the two relief outings.
"He hadn't come out of the 'pen in a while and it's easy to let the adrenaline take over, especially in a game like that against that team," Bauer said. "So he handed it great."
After a Brantley leadoff walk in the fourth, Edwin Encarnacion tied the score at 2 with a two-run blast to the home run porch in left against New York starter Masahiro Tanaka (7-2, 4.54). It was Encarnacion's 22nd home run, giving him 65 RBI. He left the game in the eighth inning after being hit on the hand by a Green pitch.
Francona said afterward that the slugger checked out OK.
"We were going to run for him anyway," Francona said. "That was a big sigh of relief. It looked like it whacked him pretty good."
What it means
The Indians reach the All-Star break with a 52-43 record, including a 4-6 mark in their last 10, and a 7.5-game lead in the American League Central over Minnesota. Last year, the Tribe led the Central by 2 1/2 games at the break.
Tanaka threw 77 pitches, 54 (70 percent) for strikes. Bauer threw 110 pitches, 74 (67 percent) for strikes.
Thanks for coming
The Yankees and Indians drew 32,644 fans to Progressive Field on Sunday afternoon. First pitch was at 1:11 p.m. with a temperature of 85 degrees.
Six Indians will head to Washington D.C. for All-Star Game festivities this week. The 89th Midsummer Classic airs Tuesday at 8 p.m. on Fox. Cleveland opens the second half of the season July 20 in Arlington against the Texas Rangers at 8:05 p.m.