Just to add to the above, clearing customs alone, (depending on arrival time) in Y takes good 30 minutes to almost hour.
If you had a 5 hour layover, only then, leaving airport would start making sense (even then it's a tight journey).
Of course, if both flights are gate parked (conveniently), had little pax on board, and your arrival/departure times are a bit off peak, then you could make use of the Marhaba service to zip through customs or have access to their lounge.
But again, if one of the flights are remote parked it's fat chance to think of leaving the terminal.
Cheers