Your iMac is too old for Mojave support.
See here: https://www.tekrevue.com/macos-mojave-system-requirements/
You can probably go to Sierra, or even High Sierra on that iMac.
If you have a late 2009 iMac, then you can run High Sierra as the newest OS:
macOS High Sierra - Technical Specifications
If not, then you would either have to go to Sierra, or stay with El Capitan. I will warn you though, Apple only actively supports the current +2 current releases at any time. So when Mojave was released, support for El Capitan was dropped. So with this said, Sierra, or High Sierra are my recommendations for you.
Here is a link to get older versions of the macOS direct from the App Store: mac appstore - How to download macOS High Sierra from the Mojave App Store? - Ask Different
There are direct links to the install application on the Mac App Store.
Pick High Sierra, or Sierra, whichever you like, or try both to see which runs best.
Sorry for the delay, took me a while to find the link again.
It wouldn't let me edit the first post, so here is the whole post over again with the needed information.