Video out from MacBook to iMac via thunderbolt
Target Display Mode can use Thunderbolt, but as you observe it was only supported on iMac models from late 2009 to mid 2014.

If both Macs are on the same network then the easiest way for one to share the other's screen is with macOS Screen Sharing, but this won't offer the same performance as Target Display Mode.

Some other options are discussed in the answers to this question.