Since this bug still exists in Homebrew as of July 2018, I thought I would share how I solved it on OS X Sierra v10.12.6
brew edit cask emacs
This will open a text editor. Search for “def install”
Paste the following line immediately below “def install”:
ENV[“cflags"]="-DMAC_OS_X_VERSION_MAX_ALLOWED=101200”
Close the editor and reinstall the cask:
brew reinstall cask emacs