There is a microphone input on the 2013 iMac. However, the tape deck outputs line level signals so they're probably not compatible, and the microphone isn't stereo and your tape deck is... I'm not sure if what you want to record should have the stereo tracks preserved separately. So it's probably not your best bet. The aforementioned USB audio interface is a way around these issues because you probably don't want to use the microphone input, not that the iMac doesn't have one.
I've done a lot of these kinds of transfers. Be careful about "microphone inputs," because -- as dyt1983 says -- you don't want to be sending line level output from the cassette recorder into a microphone input. It will overload, and there will be nothing you can do about it.
Your best bet will be to find a USB interface that has line level stereo inputs. Then on the Mac end, Audacity receives the audio and will write out files for you.
Another option is to use a digital field recorder of some kind, provided it has line level inputs. Presumably you won't want to buy one, but maybe you know somebody who has one, or perhaps you could rent one (assuming this is a one-shot project). With a device like that, you just send your audio to the recorder, where it's converted and stored internally (ideally on a card you can remove). Nothing is connected to your Mac. Then later you transfer the digitized audio (which will be files like any other) to your Mac. Then you point Audacity at them.
The last time I had to do many cassette tapes, that's the path I chose -- but it was because I had a good recorder, and wanted to set up a recording/transfer station away from my Mac. I would just hit Record on the recorder, Play on the cassette deck, and come back later. That procedure suited me better than doing it on the Mac in real time.
The tapes I was digitizing were 40 years old. If yours are old, then it would be a good idea to have some spare shells around. These will be held together by screws. If the tapes you have are in "welded" shells, and the tape breaks or gets all tangled or pulls off the hub, you can break open the shell, take the tape out, and drop it into a new shell. If you can't find empty shells, then just buy any kind of cassette that's held together with screws, throw out the new tape, and insert the old one.
I repaired broken tapes with ordinary sticky tape, because I knew it only had to stay together for one more pass (and it always did). It takes some practice, but it's not that difficult.
I will say that this last project was a reminder of just how robust magnetic tape is. The tapes were recorded in the South Pacific rain forest, stored without a great deal of care . . . and 40 years later, they were good. Now if I could just find a reel-to-reel half-track mono recorder, I could finish digitizing all my ancient tapes.