Use a tripod, go slow shutter speed (not too slow if not your subject will not be sharp as your subject will move but your bg will be correclty expose), flash power set at your normal range where your subject is so it will not overexpose. It's more manual control.
The simplest way is to use a high iso with your flash on. This normally works with backgrounds that are relatively well lit (e.g. by street lights), and you might not need to use a tripod. The downside is that the photo might be noisy.
If you want to keep the noise under control, another way is to use "slow sync flash" setting on your camera. With this you will need to set up your camera on a tripod. The camera will first fire the flash to capture your foreground subject, and then follow by a long exposure to take in the background. Your subject should remain relatively still before the shutter closes.