The magnetic needle responds to the flow of current between the free ends of a tester. When a tester is dipped into a "conducting" solution, the current will flow between the two terminals through the completed circuit and will lead to deflection in the magnetic needle.
A conducting solution contains free ions, that can conduct electricity. For a "non-conducting" solution, the circuit will not be complete and hence there would be no current flow and in such a scenario, the magnetic needle will not exhibit any deflection.
Conducting solutions typically contain acids or bases or salts. When dissolved in water, these chemicals release free ions (for example, sodium chloride or common salt, when mixed in water dissociates into sodium ion and chloride ion) which help the flow of electricity and thus complete the circuit.