The Yankees announced the deal Sunday. Garcia, a free agent after the season, will be changing teams for the second time in less than a week; he joined Minnesota on Monday after the Atlanta Braves dealt him, catcher Anthony Recker and cash considerations for a minor league pitching prospect.
Garcia will make his Yankees debut Thursday at Cleveland.
"It's what we need. It's an awesome add for this team," Yankees right fielder Aaron Judge said. "I've heard only good things about him as a clubhouse guy, and I'm excited."
The first-place Yankees also have been in active trade talks with the Oakland Athletics about ace Sonny Gray, according to ESPN and multiple reports. Garcia's acquisition does not prevent the Yankees from adding Gray, a source told ESPN's Buster Olney.
Garcia, 31, made one start for the Twins, allowing three runs on eight hits over 6⅔ innings in a 6-3 win over the Athletics on Friday. He is 5-7 with a 4.29 ERA in 19 starts this season.
"Unless we bring him back, he'll go down as one of the few undefeated pitchers in Twins history," Minnesota manager Paul Molitor said.
Garcia will take the No. 5 slot in the Yankees rotation filled since the All-Star break by Caleb Smith and Bryan Mitchell. Michael Pineda's elbow injury, which required Tommy John surgery, caused New York to search for more starting pitching.
Luis Cessa, who has made four starts this year, was the other option.
Garcia pitched for the St. Louis Cardinals from 2008 to 2016 and was dealt to the Braves in December. He started twice against Texas in the 2011 World Series, pitching seven shutout innings in Game 2 and allowing two runs over three innings in Game 6. He did not get a decision in either game.
"I think we're looking at the experience factor," Yankees manager Joe Girardi said. "It's someone that's pitched in some big games before."
The Yankees will send minor league pitchers Zack Littell and Dietrich Enns to the Twins as part of the swap and will also receive cash considerations from Minnesota.
At the time of last week's trade, the Twins were 49-48 and trailed American League Central-leading Cleveland by 2½ games. Minnesota lost four of its next five games, falling seven games back of first and four games out for the second AL wild card.
"Things have changed in the last 10 days, as far as a couple of teams getting hot and we've had a little bit of a tough time closing games out," Molitor said.
Molitor spoke to his players before Sunday's game.
"Get over it," he recalled telling them. "We are where we are. We're one run away from this thing having a different look, just the way the last 10 days kind of went against us. We're playing a lot of the teams we need to pursue down the road. It hasn't changed our focus of what we're trying to do now."
For now, New York says it has no limits on the innings of rookie Jordan Montgomery (108 1/3) and third-year pitcher Luis Severino (127 2/3). Montgomery has never thrown more than 139 1/3 innings in a season and Severino 161⅔.
Girardi doesn't envision a six-man rotation, except for perhaps an occasional turn through the rotation to give the starters extra rest.
Smith, who lasted 3⅓ innings Saturday, was optioned to Triple-A Scranton/Wilkes-Barre on Sunday, and left-hander Chasen Shreve was recalled from the Triple-A club.
Enns, 26, was 2-1 with a 1.99 ERA in eight games (seven starts) with Scranton/Wilkes-Barre and the Gulf Coast League.
Littell, 21, was 14-1 with a 1.87 ERA in 20 combined games (18 starts) with Class A Tampa and Double-A Trenton. He was acquired by the Yankees from the Seattle Mariners for reliever James Pazos in November.
The Associated Press contributed to this report.