Wireless sharing isn't possible if the iMac is connected wirelessly.
However, you can connect through Ethernet and share it. Look in the Sharing preference pane > Internet sharing.
from there you can share the iMac's internet over the airport, where your MBP can connect to.