Does "line" mean the same thing in these two sentences?

There is a narrow line between sanity and insanity.

Toe the line.
different meanings