To accomplish this, you would need to write a css media query supported in kindle which detects whether night mode is activated.
Here's a two year old thread about the topic. Not very useful, btw, and they go off on a tangent. They offer advice about how to create css media queries to target specific devices. This is not a good strategy for dealing with the issue.
You should download the latest Amazon Publishing Guidelines and maybe ask on the KDF technical formatting forum whether someone had stumbled upon a solution. I just looked there and found nothing.
In web browsers, you can make a css media query to detect night mode by matching color; ie, if color=black, then use this css color, etc. But that wouldn't work on a specific platform like Kindle, I'm guessing.
The thinking behind night mode is to provide complimentary colors. Its algorithm for determining what is complimentary is not documented yet, nor do I know a css media query for Kindle which you can use. It would require a good amount of testing to figure it out on your own, I'm guessing.
At the moment, I don't see an easy way to accomplish what you want -- though there probably is a need. That said, I do generally trust the algorithms in night mode which try to maximize contrast.