While one can install the Nvidia K4100m MXM boards, there is quite a lot of steps to make it work, it’s not something I recommend any more as there are quite a lot of used systems with better graphics today with better CPUs as well.
But if you’re hell bent give this a YouTube a view [https://www.youtube.com/watch?v=7bjZQn4jsoU&t=40s|k4100m vbios available for 2011 iMac GPU upgrade!]