Yes they will work, but just keep in mind that older mags will have the older shorter floor plate and the black follower. No big deal at all IMHO, but I talked with someone last week who was all worked up about needing only gen 5 mags for their gen 5 gun.
Thank you all for the quick response. I'm on the fence about buying a gen 5. I'm happy with the gen 4's that I own. I'm thinking about buying a G17 and wondered just in case I went gen 5 instead of gen 4.
I have a real hankering for a gen 5 G19. I had a gen 3 G23 that I traded in for a M&P9c that I carry, but miss having a mid-size Glock. My G29 doesn't count...