There are two possibilities:
1) Each socket has its own unique identifier stored in socket.id. If you know the identifier of both users, you can simply use
io.sockets[id].emit(...)
2) Define your own identifier (e.g. username) and use
socket.join('priv/John');
connection. , John,
socket.broadcast.to('priv/John').emit(...)
: , .