If the charge instead moves perpendicular to a current-carrying wire, electrostatics cannot be used to derive the magnetic force. In this case, it can instead be derived by considering the relativistic compression of the electric field due to the motion of the charges in the wire.