Trying to use an iMac as a second screen, but it keeps dimming I'm hooking up my new MacBook Pro (13-inch 2016) to my old iMac (27-inch late 2012) using a lightning-to-USBC converter, in order to use the latter as a screen when working from home.

Pressing CMD-F2 on the iMac keyboard successfully connects the monitor. Hurrah!

But - boo! - 9 times out of 10, the brightness on the second screen drops to a minimal level, and can't be changed.

Sometimes (about 1 in 10) it retains the level that it's set to to start with. But most of the time it doesn't. And perhaps more annoyingly, as far as I can tell there is no way to change the brightness on the iMac screen once the MacBook Pro is using it as a screen.

Any way to either a) ensure it doesn't drop brightness when connecting or b) allow me to change the brightness on the iMac screen once it's being driven by the MacBook Pro would be much appreciated.
Pulling my own answer out of the comments: The workaround is to log out of the iMac, leaving it showing the login screen.

CMD-F2 will then connect the laptop to the iMac screen without dimming.