Cannot connect to Wireless Keyboard
That's actually a feature, albeit a very poorly documented one.

The Apple Wireless Keyboard refuses attempts to be overtaken by a different host without a deliberate disconnect, physical access by the user, a very long timeout or a manual reset.

Your keyboard model is that of "October 2009", the manual can be found here: https://manuals.info.apple.com/MANUALS/1000/MA1208/en_US/Apple_Wireless_Keyboard_2009_UG.pdf

Page 6 states that you should disconnect (not unpair) your keyboard before connecting (or pairing) it to another computer.

Once the keyboard is no longer in a 'connected' state, it will happily reconnect to any device it has previously been paired to.

So in order to resolve your problem, you should either take your keyboard back to the computer it believes to be connected to (and explicitly disconnect it there) or try the following in order to disconnect it manually:


open the "Keyboard" pane in "System Preferences" and choose "Set Up Bluetooth Keyboard..." (or search for devices via the "Bluetooth" pane as an alternative), 
power off your keyboard by pressing and holding the power button (on its side),
release the power button after the indicator light goes out (your keyboard is now in standby mode),
press and hold the (same) power button for as long as it takes for your keyboard to be successfully connected by your target computer (the indicator light will blink during the course of this step).


 

In case you release the power button too early, i.e. without fully establishing a connection, the keyboard will simply fall back into the mode it was before – still connected to the other computer, safe from being overtaken. :)