One of the sticking points in the negotiations between Conan O'Brien and NBC is a custody battle -- who gets Triumph the Insult Comic Dog and other characters Conan has created over the years ... sources tell TMZ. But we're told Conan will bag the dog, with strings attached.

Sources say Conan and NBC are "close" on his "Tonight Show" exit agreement -- but one of the remaining sticking points is intellectual property. Conan's characters -- like Triumph, the Pimpbot 5000 and the Masturbating Bear -- are all legally the property of NBC (Triumph's rights are a little tricky and may be the property of Conan's longtime friend Robert Smigel).

Conan wants to take them with him wherever he lands -- and we're told NBC will ultimately give Conan the right to his characters, in return for conceding other points in the exit deal.

As for what Conan may have to concede ... we're told the non-disparagement clause is still an issue. Specifically, how long will Conan be prohibited from trashing NBC? Conan may have to fold on this point in order to walk the dog.

Bottom line -- looks like the Masturbating Bear will live to self-gratify another day.