You wont be able to wire it through those connectors unless you have the connectors in the car for it to fit into.
You have a couple of options, you can wire the actual motor up to a 12v battery with switchable polarity, you will need a suitable switch etc. You will also need to wire in suitable micro switches to stop the motor when it is fully open or closed or you could just use a push to make switch I suppose.
Or just unscrew the motor and the cubby will open and close manually
I had the first option working but it is a complete pain in the @r$e so now I have removed the motor and just open and close the cubby manually.
Making it open or close with the ignition would be harder still and would definitely need mocro switches to turn off the voltage when the cubby was fully open or closed
I would have a play around, get a 12v battery from maplins or somewhere or just a 9v one will work and then wire it up to the motor terminals just to make sure the motor works etc...
One of these + a 9v battery
Then you can have a play....
If you had used the forum search and put in "motorised cubby" which is actually part of your thread title, you would have found this thread -
http://www.350z-uk.com/forum/viewtopic.php?f=27&t=54590&hilit=motorised+cubby
or even the thread that that bazmcc posted asking the same thing
http://www.350z-uk.com/forum/viewtopic.php?f=20&t=57594&hilit=motorised+cubby