Hello and welcome,
I personally don't recommend performing upgrades of that type. That said, I doubt the 2013 iMac models would support an I9, since it was originally only available with specific I3, I5, or I7 processors depending on the exact 2013 model you have.
C