The Aperture SLA says one desktop computer and one laptop computer as long as both computers are owned and used by you:
http://images.apple.com/legal/sla/docs/aperture.pdf
See the paragraph 2b for the Single User License.
If it were me, I would either call or email sales or support and clarify if you can use on both iMacs (they may be willing to let that go). The proviso is that you cannot have both machines running Aperture (loaded in memory) at the same time if installed with the same serial number.
Your better bet may be to look into the Mac App store version (although I see your info says OS X 10.5.7 which would rule that out).
It certainly won't hurt to contact Apple to be sure. 😉