I don't think you can do that with the stock OS X Internet Sharing. When you use internet sharing on the iMac, OS X uses natd to provide NAT to your G3. Essentially the iMac becomes a router, serving the G3 as a subnet. The G3's IP is shielded from the rest of yoru network (the iMac's IP is used for both machines' internet connections) and there's no way to add port forwarding to the OS X Internet Sharing.
You could possibly turn off OS X internet sharing (disabling natd) and assign your G3 a static IP address on the router's subnet, specify the router and netmask as well, and reach the router directly through routed (using the iMac as a switch rather than a router.) Not sure if that will work automagically or if you'll need to use some Unix route commands in the Terminal.
(Addemdum: Nope, doesn't work automagically.)