Leave it Alex Rodriguez, with an assist to his girlfriend Jennifer Lopez, in helping Gary Sanchez emerge from his defensive slump and go on an offensive tear.

“The idea is to try to hit it up the middle,’’ Sanchez said after hitting a homer and a long sac fly against Jacob deGrom in the Yankees’ 5-4 win against the Mets at the Stadium, giving them wins in both Bronx games as the Subway Series shifts to Queens on Wednesday night.

On this just-concluded homestand, Sanchez was 8-for-17 in five starts with three home runs.

Recently, Sanchez had lunch with A-Rod and J-Lo and “we talked about pretty much everything. Everything that comes from him, it’s positive,’’ Sanchez said via interpreter. “We talked a little bit about defense, creating a routine, following your routine, preparing for games.