Thanks for the update. I would next restart your router and/or modem by unplugging them for about 30 seconds. Once they are back on and you can connect to the internet with other devices test the issue again from the iMac.
If it persists then I would recreate the Wi-Fi network service in your System Preferences.
1. Disconnect from the Wi-Fi network if you are already connected
2. Click System Preferences
3. Click the Network icon
4. Click the Wi-Fi connection in the list you see to the left
5. Click the minus button to the bottom left of the list
6. Restart the computer
7. Go back to Network in System Preferences
8. Click the '+' in the lower left of the network services list
9. Click Wi-Fi from the dropdown menu labeled 'Interface'
10. Leave service name at default (It should say 'Wi-Fi') and click Create
Then attempt joining the network again and getting to the internet.