Trying to use an iMac as a second screen, but it keeps dimming
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.