"Toe the line" is an idiomatic expression meaning to conform to a rule or a established standard
"thread the needle" is:
1) Technical definition: to put a piece of thread through a needle
2) Definition as an expression: to skillfully navigate a difficult problem (like putting a piece of thread through a needle, it has to be done very carefully and precisely)
3) Billiards definition: is to precisely shoot the object ball or the cue ball through a very tight or narrow pathway to it's intended destination. (Note this is an application of definition #2, using it for billiards)
Some people believe 'thread the needle' is similar to the expression "walk a fine line" which means to maintain a fragile balance between one extreme and another, (For example such as: needing to be very careful not to annoy or anger two or more people or groups who have differing opinions)