Homebrew says I got the latest version of Emacs installed, but the emacs command indicates it’s still the old version

I updated my emacs version using Homebrew. If I now execute

brew upgrade emacs

the following message appears:

emacs 27.2 already installed

However, when I execute

emacs --version

the following message appears:

GNU Emacs 26.2

Running

which emacs

returns

/usr/local/bin/emacs

How can I get the emacs command to point to the new version?

P.S. There’s a similar post on this forum, but the answer to it isn’t relevant to me.