Short answer - no you can't...
Nodejs22 (minimum we need) requires gcc-9 which doesn't seem to be in the Buster repo.
However if I manually upgrade to Bullseye (by sudo editing /etc/apt/souces.list and /etc/apt/sources.list.d/raspi.list to say bullseye instead of buster - then do a sudo apt update && sudo apt full-upgrade then reboot) - then I get gcc-10 which is sufficient. However even then I have to use the "old" install script which you can download from here - https://raw.githubusercontent.com/node-red/linux-installers/refs/heads/master/deb/update-nodejs-and-nodered - which then installs nodejs22 and Node-RED 5.0.1.
So yes it can be made to work... but I would make sure I have backups before I proceeded to do it this way - and I can hardly recommend it as Bullseye is also long in the tooth and goes EOL Aug 31st.