Yup that RAM is compatible. Here’s a page with the full specs for that iMac.
https://everymac.com/systems/apple/imac/specs/imac-core-i5-3.5-27-inch-aluminum-retina-5k-mid-2017-specs.html
And the video linked above is the correct iMac, so that’s a good video to use as a guide.