CHICAGO -- The White Sox put a lousy weekend in Kansas City behind them in a hurry. Really, there was no choice with the New York Yankees coming to town to start a three-game series between first-place teams.
"We played so bad in Kansas City," Dunn said of three-game sweep by the Royals that featured some sloppy baseball by the White Sox.
"The energy was going down a little bit in Kansas City. We didn't get off to a good start tonight. I think it shows the resiliency of this team. Obviously tonight wasn't looking good. We had some opportunities early to drive some runs in and we didn't and fell behind. We just kept battling."
"Every game is important. What happened in Kansas City, we have to leave in the past. The race is so tight, every night is going to be important," said Ramirez, who lost a double earlier in the game when umpires changed a call and ruled his bouncer over third foul.
"That's baseball. The calls will go your way in certain instances and I just had to take it in stride," Ramirez said. "Fortunately I was able to hit the home run and more importantly we won the game, that's the most important thing of all."
Ramirez connected with two outs in the seventh off Boone Logan (4-2) for his seventh homer of the season. Brett Myers (2-1) got the win by pitching two-thirds of an inning. Addison Reed worked the ninth for his 22nd save in 25 chances.
"It's tough to swallow. We've been scuffling as a whole down there lately," Logan said. "You gotta grind through it and get through it. We know that and we talk about it. We're doing the best we can."
Ramirez's homer came on a 3-2 pitch.
"It was a bad pitch, either way, but I was looking to throw it low, in the dirt. I was gonna show it to him, but in the dirt," Logan said. "If I walked him, onto the next guy. If he swings, I strike him out."
New York's Derek Jeter homered and had four hits, tying Eddie Murray for 11th place on the career hits list (3,255). He also took over 13th place on the runs scored list (1,845), passing Craig Biggio.
"He just continues to have big days for us. That's what he's doing. It is pretty amazing," Yankees manager Joe Girardi said.
Wise hit a two-run homer for Chicago as the White Sox scored five times in the fifth for a 5-3 lead, but the Yankees quickly went ahead in the top of the sixth on Jeter's solo homer and RBI singles by Mark Teixeira and pinch-hitter Casey McGehee.
However, Beckham homered off Joba Chamberlain to start the bottom of the sixth, tying it at 6.
The Yankees scored three early runs against White Sox starter Gavin Floyd, who was wild from the outset and lasted only 2 1/3 innings.
Wise, designated for assignment by the Yankees in July, hit his sixth homer in the fifth, shortly after umpires reversed a call and ruled that an apparent double by Ramirez was a foul ball.
"I mean I'm not going to lie. When you play against a former team you obviously want to go out there and try and do well," Wise said. "I don't think too many people can leave one team that was in first place and come to another one, so I'm pretty blessed and just glad to be here."
Ramirez led off with a bouncer over third that third base umpire Bill Welke ruled a fair ball with Ramirez reaching second. But after an umps' conference, they reversed the call and ruled it was foul. White Sox manager Robin Ventura came out of the dugout for an explanation but the changed call stood and Ramirez then struck out. At the time it was a pivotal call because Beckham followed with a single and then Wise homered.
A.J. Pierzynski greeted reliever Clay Rapada with an RBI single to center, giving Chicago a 4-3 lead and after the Yankees brought in their fourth pitcher of the inning in Chamberlain, Dayan Viciedo hit another run-scoring single.
Jeter hit the game's first pitch for a single, tying him with Nap Lajoie for 12th place on the career list. Nick Swisher walked before Beckham made a nice back-handed stop on Robinson Cano's grounder to get a force at second. Teixeira hit an RBI single and Eric Chavez a run-scoring fielder's choice.
Curtis Granderson hit a bases-loaded single to make it 3-0 in the second before Rios' strong throw from right cut down Cano at the plate for the final out.
Garcia lasted 4 1/3 innings. He gave up six hits and five runs with eight strikeouts.
Floyd threw 50 pitches in the first two innings and was yanked after just 2 1/3 innings -- his shortest outing of the season -- when he gave up five hits, three runs and four walks.
Yankees ace CC Sabathia is scheduled to throw a bullpen session this week and manager Joe Girardi said how the left-hander feels after that workout could determine if he can come off the DL and return to the rotation. ... White Sox CF and leadoff hitter Alejandro De Aza missed his third straight game with a sore back.