You need to run a third-party game in steam. With steam, you can run the game by its ID. But how to start the game is not associated with Steam 
2 answers
You can find the id of a third-party game on Steam by creating a shortcut on the desktop from the games library, in the shortcut properties there will be a link like steam: // rungameid / 16129557454605254656 , where 16129557454605254656 is the id of the third-party game.
Actually, you can start the game from the browser by calling the link from the shortcut.
Perhaps on different computers id third-party games will be different, not tested.
- I tried to run the game by its id. It started but for some reason it does not write the name just writes In a game not related to Steam - Kasper
- @Kasper if you specify the name in the properties of the game in the library, it is correctly displayed in the profile when you open the link (checked on the latest stable version of Steam) - Alexey Shabalin
In general, no way . Steam uses its service, which listens to requests via the steam:// protocol. "Custom" game has no such service. If you wish, you can write it, but given that games can be scattered in any part of the system, this is a time consuming and almost impossible task.