To install that “emacs-mac” branch of Emacs with the Homebrew package manager, see the instructions on https://github.com/railwaycat/homebrew-emacsmacport. Homebrew’s built-in formula directory doesn’t include that version of Emacs, so that linked repo is a “tap” that defines a formula for it. From the README of that repo, these were the only commands I needed to run:
brew tap railwaycat/emacsmacport
brew cask install emacs-mac