The following indicates MacOS 10.13 is the minimum system. https://support.microsoft.com/en-us/office/system-requirements-and-supported-accounts-46a8d501-0d1f-4145-ab0f-286bc7dcf780
If you want to see if you can upgrade your iMac;
The model year of an iMac is available at Apple menu > About This Mac.
An early 2009 iMac can be upgraded to El Capitan 10.11.6 but no later version. See: https://support.apple.com/en-us/HT211683
A late 2009 through mid 2011 iMac can be upgraded to High Sierra 10.13.6 but no later version. See: https://support.apple.com/en-us/HT211683
A late 2012 through late 2013 iMac can be upgraded to Catalina 10.15.7 but no later. See: https://support.apple.com/en-us/HT211683
A mid 2014 and late 2014 can be upgraded to the latest version of Big Sur macOS 11 but no later. See: https://support.apple.com/en-us/HT211683
A late 2015 or later can be upgraded to the current version of Monterey macOS 12. See: https://support.apple.com/en-us/HT212735
If you can't or don't want to upgrade your iMac some alternatives for Office are:
The free and very good Libre Office https://www.libreoffice.org/
or the free Microsoft Office on the web: https://products.office.com/en-us/free-office-online-for-the-web
or Google Docs: https://www.google.com/docs/about/
or Apple’s Pages and Numbers