There is an interesting GUI tool that is supposed to allow you to do this with frame accuracy by re-encoding the section of the cut video before the first keyframe, and merging it with the losslessly copied section. However unfortunately in practice I have found it so unreliable as to be useless. I wonder if there is a similar better tool for this.