Not Target Display Mode, but you can screen share the M1 mini onto the 2013 iMac and control it via that iMac keyboard and mouse. Ideally, if it is to be done at all, should be over fast 1000BaseT (or faster). I have a 32-inch display on my M1 mini so have no need to display it onto my Late-2013 27-inch iMac, but screen sharing is possible, as I just tested it.
On the M1 mini, you visit System Preferences > Sharing, and select Screen Sharing. If your firewall is on, it may be automatically set to block all incoming connections, and in System Preferences > Security & Privacy, you will want to change the Firewall options to:
and on the 2013 iMac, you want to drag and drop the /Systems/Library/CoreServices/Applications/Screen Sharing.app to your Dock. When you launch it, you will want to enter the hostname of the M1 mini with the .local suffix. Once the M1 mini screen is up on the 27-inch iMac, you can drag/drop files between them.
Apple has the Share the screen of another Mac for reference.