Is it acceptable, or to code, to splice electrical wire outside of a junction box behind drywall?
It is generally not acceptable to have wire junctions be inaccessible.  The rule of thumb is:  All junctions must be in a box, but that box must be accessible - you cannot legally close a box up behind drywall.

There are some limited exceptions, as noted here.

You should run a new line if you don't have the slack.