PVC to ABS Recommendations
It appears in the photo that the pipe stub coming out of the wall has some extra length that could be removed, a new "Y" installed which would give you the needed space.

It's a little difficult to judge the length but it appears there is a good 2" there.