At the time of their initial meeting, Woltz didn't know Tom was connected with Corleone.
But if he had prior knowledge of the bandleader story, he would know Johnny had a connection to Vito, so if a mobster approached him about Johnny he could assume the Corleones were involved.
Woltz let his ego and libido get in the way of dealing with Hagen.