There are 6 versions of Mountain Lion from 10.8 to 10.8.5. You don’t mention which one you have.
Try downloading and installing OS X Mountain Lion Update v10.8.5 (Combo)
https://support.apple.com/kb/dl1676?locale=en_US
After that Apples suggests installing upgrade to El Capitan 10.11 first. :
https://support.apple.com/en-ca/HT211683
Look down the page for El Capitan 10.11 link to dmg file. Click on it and save.
A note from Apple:
“If you’re running Mountain Lion 10.8, you will need to upgrade to El Capitan 10.11 first.”