It can certainly be done.
Is this the early 2009? That one can only go to El Capitan.
The late 2009 can be updated to High Sierra.
The 2009 iMac doesn't have Thunderbolt (2011 and later iMacs) or USB3 (2012 and later iMacs).
Not sure if TB3 to TB2 adapter to TB to Firewire adapter with a FW800 cable from the adapter to the 2009 iMac in Target disk Mode would work or not. If that does that would probably be the fastest, but not the cheapest.
Another option would be to get an external SSD with USB3 and FW800 ports. Backup from the 2009 with the FW800 port and then restore to the iMac using the USB3 port.
An example would be
https://eshop.macsales.com/item/OWC/MS8U3SSD480/ (you can just get the enclosure and put your own SSD in if you have one lying around).
Or you could transfer the data over your wired ethernet network if both iMacs are plugged in to your router/switch via ethernet (ethernet is better for reliability than wifi and is generally much faster too especially with older computers that have slower wifi)
If the 2009 iMac is still working you could give it a new lease of life by putting an SSD into it or if not comfortable opening it up to do that booting it off a FW800 SSD. Super Duper or Carbon Copy Cloner could be used to clone the hard drive onto the new boot drive.
SuperDuper is free for doing a full clone, but you'll need to use version 3.2.5 of that software with El Capitan which you can get here:
https://www.shirtpocket.com/blog/index.php/shadedgrey/comments/happy_thanksgiving_update/
Once the clone is done you then go into System Preferences > Startup disk and select the external as the startup disk.
I recently connected a FW800 SSD to a 2009 Mac Mini (slower machine than your 2009 iMac) running El Capitan and it feels like a much newer machine now. Problems that I had with it before due to the slow HDD have disappeared or been significantly alleviated.
Technology has advanced over the past 11 years, but the major bottleneck in an old machine is the hard drive.