When you volunteer for something that may have a bad ending, when you enter an argument in which you may turn out to be a poor second, or whenever you deliberately take the chance of being hurt, literally or figuratively, you are sticking your neck out.
The saying is modern American slang, an outgrowth of the earlier, “to get it in the neck,” both of them alluding to the neck of a chicken stretched for the ax.
The other saying attained popularity during the last quarter of the nineteenth century.