Nameable Players is an addon that allows you to do exactly that. Working for 1.16+ simply use an anvil to rename a nametag then use it on your friend. This addon works using the default nametag and is compatible with craftable nametag addons!
Start by renaming your nametag in an anvil
Go up to a player and tap the “name” button on mobile, Left trigger on controller, or right click on mouse
There’s a lot of fun things you can do with this addon like give your friend no name
You can give your friends super long names
You can even recolor the nametag to have colored names
Added resource pack to allow players to use custom text.
Added 1.16.201+ support