ssh -o ProxyCommand='nc -X4 -x 0:9150 %h %p' user@host
with -X (caps) you specify to netcat the proxy version you are using, in this case SOCKS4.
Taken from the man page:
-X proxy_version
Requests that nc should use the specified protocol when talking to the proxy server. Supported protocols are ``4'' (SOCKS v.4), ``5'' (SOCKS v.5) and ``connect'' (HTTPS proxy). If the protocol is not specified, SOCKS version 5 is used.
So, if you were trying using netcat with the 'connect' argument for -X it will not work because that TOR port is SOCKS4 and not HTTP proxy.
I hope you find this info useful.
PD: I used 0 on hostname parameter because its the same as 127.0.0.1, or localhost.