Justiceinacan has it right. They call it "z170" because that was the cool board at the time.
What it boils down to, is that both the z170 and the z370 use DDR4 ram, so yes, it will work.
What I would consider tho, is the speed of that ram (2400 Mhz). Look up your z370 motherboard specs
and see what is the maximum (OC) speed it can support, since you are getting an overclockable CPU, and may regret you didn't grab potentially faster ram. Don't be scared, overclocking ram is as simple as enabling XMP (Xtreme Memory Profile?) in the BIOS. For instance, my z170 board runs 2400 Mhz ram, but supports 3200 Mhz in XMP. I enabled XMP in the BIOS, and it runs my 3200 Mhz at 3200 Mhz. To be honest, that speed difference is nothing to write home to mom about, but what the heck, right? The difference you save by going down to 2400 Mhz vs faster DDR4 ram may not be much at all.