Whether or not you should cite Y I think depends on what the thing you're citing is. If it is the main topic of that work and they came up with it or developed it, you should cite them. If they just mentioned it in passing, maybe in their introduction, I would cite Z as they are the originator of the information you want to quote, Y is just how you found the citation of that information.
Now to tackle the elephant in the room: citing without reading! Let's be honest, we all do it. I'm not saying you should take what is in Y as gospel and cite Z without any other knowledge of it, but if the information is well known in your field and everyone regularly says it and cites Z, and you are in a hurry, I'm sure people do just cite Z.
I'm not saying you should, but it happens.
I would say that you should probably read all those "often cited" background papers in your area at some point, and read them critically. Just because everyone cites it and takes that knowledge as given, doesn't mean you shouldn't assess it carefully and draw your own conclusions. If you think everyone cites it wrong you could write a paper or letter correcting it and then get loads of citations yourself!