Update from os x 10.4 to 10.9 with time machine backup
You can create a bootable Mavericks USB flash drive or DVD on your Macbook Pro (the 10.9) machine using the steps in this Apple note

You can then boot your iMac off this media and install 10.9

You can connect the iMac to your Time Machine backup (e.g. plug the disk in or attack via network) and during the install tell the install to get data from the Time Machine backup.

You can't install a version of  OSX from a Time Machine backup you need to install OSX first.

An alternative is to create a bootable backup from the 10.9 machine using Carbon Copy Cloner or Superduper etc and then boot the iMac from that and restore from it.