Is it possible to share the internet through the airport extreme using it like a hub really?!
Do you have iMac #1 configured to use OS X's Internet Sharing feature to share its wireless Internet connection via its Ethernet port? If so, then connecting iMac #2 directly to that Ethernet port should provide it with Internet access as I believe you have already found out.
By default, the AirPort Extreme Base Station (AEBSn) will perform as an Internet router. It may be possible to use it only as a Ethernet switch by reconfiguring it as a bridge (Connection Sharing = Off (Bridge Mode)), and disabling its radios (Wireless Mode = Off.) However, I haven't verified this when the AEBSn is connected back to a computer configured for Internet Sharing.