In both of your sentences, the negative infinitive appears in the reverse of its normal form, which is not to [verb]. This is grammatically correct, but it is not the customary usage.
In some cases, this reversed form is used in speech to stress the negation, with emphasis placed upon "not." Contrast the following two versions of your first sentence, the first in normal negative infinitive order and the second in reverse order:
I brought it to you in order not to give it to her.
I brought it to you in order to not give it to her.
Although in written English the difference is nearly indistinguishable, in speech the suggestion in the second sentence is that I am not merely refraining from giving whatever it is to her, but that I am actively not giving it.
In his answer to a similiar question at our sister site ELU (which I have largely purloined here) Colin Fine cites a perfect example of this usage:
So "I try not to care" would be normal, but "I try to not care" would be spoken with an emphasis on the "not", and would suggest that I am trying very hard to do something specific:† "not caring" instead of caring.
Many native English speakers were taught in school that there is a "rule" which proscribes separating "to" from the base form of verb, resulting in the dreaded "split infinitive." If this fallacy has also been taught to you, it may explain why you are unsure about the correctness of your examples. There is no grammatical reason to avoid separating "to" from the base verb, as long as sense is preserved; "not" (or any other adverb) is free to boldly intervene.
Your question includes the added complication that the phrase in order is frequently superfluous when used to precede an infinitive, e.g.:
We use shampoo
in order to wash our hair.
If the phrase is removed from your first example sentence, the meaning is preserved:
I brought it to you to not give it to her.
†Alert readers will see that I have added a colon to Colin Fine's original; try as I might, I can't parse his sentence as written without it.