Ibanez's blast inside the right-field foul pole sparked the Bombers' offense after they had been blanked by right-hander Chris Young through the first six frames.
The Yankees knew the gap could be closed with just a few timely swings. It was a formula that worked during their Subway Series sweep at Yankee Stadium earlier this month, when the Bombers hit eight homers to account for 12 of their 18 runs.
"When you think about our club, they're in scoring position when they walk to the plate," Yankees manager Joe Girardi said. "That's the type of club that we have."
Mark Teixeira started the seventh with a walk -- one pitch after nearly striking out on a foul tip that catcher Josh Thole couldn't hold -- and Nick Swisher sliced a ball that right fielder Lucas Duda broke back on, misplaying it into a double, the 1,000th hit of Swisher's career.
Ibanez took advantage of the breaks and laced the first pitch he saw down the right-field line, clearing the eight-foot fence to tie the game and knock Young out of the contest with a no-decision.
"I was just trying to get a guy in," Ibanez said. "When I hit it, I thought I was going to have to run hard to try to get two [bases]. Fortunately for us, it went out of the park."
Chavez then gave the Yankees the lead when he blasted his first career pinch-hit homer down the left-field line off reliever Jon Rauch (3-7), ripping an 0-2 pitch.
"He hit a good pitch," Rauch said. "He takes a panic swing and somehow barreled it. I think everybody in this clubhouse is amazed that he was able to do that with that pitch."
For Chavez, the owner of 237 Major League home runs, the blast was the first career pinch-hit shot in 64 such at-bats.
"Pinch-hitting is hard just in general," Chavez said. "You're just trying to make contact up there, really. ... The one thing that we have is the players to do it. We feel like we're in every game, regardless of what the score is."
Rafael Soriano picked up his 18th save with a scoreless ninth, helping the Yankees secure their fourth win in five Subway Series meetings with their crosstown rivals this season.
The biggest outs might have come in relief of starter Ivan Nova, as Clay Rapada (2-0) got the final out of the sixth, Boone Logan struck out both batters he faced in the seventh and David Robertson fanned the side in the eighth around two walks. The Mets struck out 15 times in all, tying their season high.
"It felt good," Robertson said. "The atmosphere was really intense tonight. Everybody came in and got their job done and got the tough outs to help push us forward to a win."
The Mets touched Nova for three runs (two earned) in 5 2/3 innings, including a run-scoring single by Young in the sixth inning that knocked Nova out of the game, snapping his five-start winning streak.
"I thought he threw a pretty good game; he didn't give up a lot of hits," Girardi said.
Kirk Nieuwenhuis slugged a solo homer off Nova in the third inning and an Alex Rodriguez error led to an unearned run in the fourth, as Rodriguez booted Scott Hairston's grounder and the run scored on a groundout.
Nova's 99th and final pitch was laced into right field by Young after an intentional walk to get to the pitcher, and Nova said he'd made the offering too comfortable for Young.
"That's the only pitch I questioned myself," Nova said.
The hit would prove to be little consolation for Young once the seventh-inning lead evaporated, something that brought cheers from Nova's corner of the visitors' clubhouse.
"After I came out, I was thinking that we have to wake up now," Nova said. "We have to win."
The victory seemed to put the Yankees back on track, stopping a three-game losing skid from growing any larger following the club's season-high 10-game winning streak that stretched into the earlier part of the week.
"You definitely don't want that to happen, especially after winning 10 in a row," Ibanez said. "Today was a big win for us."