Is it the original Magic Mouse with the replaceable AA batteries? Or the newer one with the Lightning or USB-C connector? If the latter, does it work after you plug it in and unplug it?
Worst case is, if you can log in, you can pair it using the keyboard. Once logged in, press Command ⌘ + space to open Spotlight Search. Then type "System Settings" (if nothing is found for System Settings, you likely have an older macOS version in which it was called "System Preferences," so try typing that instead). Press the return key to open the app. Use the down arrow to get to the Bluetooth menu. The Magic Mouse should be discoverable under the "nearby devices" section. Repeatedly press the tab key until the "Connect" button next to the Magic Mouse is highlighted, and then press return.