Confirming the answer is no. I have the same 2012 iMac 27" which I use for TDM to run a 2019 MBP15,4. When I connect my M5 MacBook Pro to the iMac, the cmd+F2 shortcut is non-responsive. I believe it's a hardware limitation of the Apple Silicon Macs as they don't send a display signal over Thunderbolt.
P.S. Best to move this thread to another forum as it's not PowerPC-related.