Click the lock, enter your password then select "Anywhere" and try opening it. Once its been opened once you can change the settings back from Anywhere to Mac App Store and identified developers
Sierra no longer has an 'Anywhere' feature. However, if you right-click (two-finger tap) the App and click 'Open', you should get the ability to open the app.