The remote machine needs to ssh into a machine available to the internet to create a proxy.
ssh -t -R <port>:localhost:22 remote "ssh -C2TNv -D <proxy port> <local user>@localhost -p <port>"Then, configure your application to use socks5://localhost:<proxy port>
as it's proxy.
Enjoy!