What I've read, it is possible in principle. But only with a Thunderbolt cable. Since the 2011 has TB2, and the 2019 has TB3, you'll need a specific thunderbolt 3 to thunderbolt 2 cable. It looks like a USB-C to Mini Display Port cable, and those cables are more common and cheaper, but those won't work.
Don't forget that you also need to connect an Apple keyboard to the 2011 iMac, because only then the command-F2 works.