OK, so this is a tricky question. It can be either legal or illegal, depending on what team 1 did on the 5.
Even if it's inadvertent, if team 1 made an attempt to hit or move the ball with the 5-bar, i.e: made a 'controlling advancement', then it's illegal. The defender may not have wanted to do this, but if the forward moved into the ball, then it's a stopped ball pass.
If the forward didn't move the 5-bar and the ball touches the 5, or if the forward attempted to move out of the way with the 5, but the ball grazes the 5 anyways, then the pass is legal.