If you open the program inside the .dmg, the .app by right-click open, it should give you the choice to open anyway.
Else, click the apple (upper left corner of the mac) > system settings (or equivalent, mine is not in english) > Security and Confidentiality > General Tab > Lower part, you should have a message saying the mac blocked an app, you click to unlock