How to use extract cmd/ old version of x?

my Scenario is this: New Mac brew install ghostscript which installed ghostscript 9.5 which breaks my rails app. Old mac has ghostscript 9.25 which works.
brew search ghostscript
> ghostscript

I see there is an extract command but how do I know what [tap] is?
brew extract --version ghostscript <tap>