It’s a pain in the ass to have to look this up every time I do this. So here it goes:
Install Homebrew versions:
$ brew tap homebrew/versions
Look for the package you need:
$ brew search node
That is going to return a list of packages with keywords matching “node”
$ leafnode node node010 node04 node06 node08 nodebrew nodenv
Install the package with the version you need:
$ brew install node010
Then…
$ brew link --overwrite node010
Done.