Hello
The decisive factor is whether the Imac has a VESA mount on the back, which are four mounting holes in a square for screws, either 75 x 75 mm or 100 x 100 mm apart. See also Wikipedia, article "Video Electronics Standards Association", last section "VESA mounts (screen mounts)".
Greetings Rolf