The high five is a taunt, so you need to own it before you can use it. You can find it in the Mann Co. Store, receive it in a drop, or trade another item for it.
Once it is in your backpack, equip it in a taunt slot. In game, the taunt is bound to a key, commonly G, though it is worth checking your key bindings in the options menu if nothing happens.
With it equipped, press the key next to a teammate and the pair of you will slap hands.