iTunes syncing is generally in one direction, from iTunes library to iPod. You cannot use iTunes to transfer song files from iPod to computer (except for songs purchased from the iTunes Store). However, there are third-party methods and utilities that can transfer from iPod to computer. If you do an Internet search on something like "ipod transfer," you should get some links. (The CNET article seems to be popular.)
Once the song files are on your computer's drive, you can add them to your new iMac's iTunes library.
NOTE: Ideally, you should transfer your complete iTunes library from your old computer to your new computer, and not use your iPod. If you can do it that way, please post back.