In order to build KWin against KDE Frameworks 5, one needs to have a working frameworks setup. For this follow the steps outlined in Frameworks/Building. This should also build kwin.
To get KWin working properly on Frameworks there are many tasks to be solved. These tasks can be found in the KWin/Frameworks Trello board. If you want to work on a task please contact Martin Gräßlin (mgraesslin on IRC, email mgraesslin at kde dot org) to be added to the board and assign a task to yourself.
Please see KWin/Hacking for further information about the structure of KWin.
Follow the runtime instructions in Frameworks/Building - especially ensure that you started D-Bus. Otherwise KWin 5 and a running KWin 4 might conflict on the DBus. Apart from that there is nothing special to consider. KWin 5 can be started just like KWin 4 with _x11 at end . If a window manager is already running, use:
kwin_x11 --replace &