It's just about time for Tekashi 6ix9ine[1] to pay the piper, testifying in open court against his alleged kidnappers ... while knowing full well it could make his family members targets of gang retaliation.

The rapper -- who's currently incarcerated[2] on federal racketeering charges -- is expected to testify next month about the kidnapping and assault he claims he fell victim[3] to in 2018. Cops arrested a suspect in the case, who pled not guilty, and also claims Tekashi made up the whole thing.

FYI, the guy calling BS -- Anthony Ellison -- was formerly part of Tekashi's management team and cops believe he's affiliated with the Nine Trey Bloods, the same gang[4] Tekashi was with prior to his bust. Bottom line ... they know each other well.

That's what makes this situation[5] messy for Tekashi -- he's currently preparing to point the finger at this guy, and the potential ramifications are very serious. Sources connected to the case tell TMZ, 6ix9ine's crapping his pants over testifying -- worried about how his mother and brother could be harmed[6], and also for his own safety behind bars. We're told he knows this could make him a marked man for life.

We already know 6ix9ine has shelled out[7] thousands for security to protect his mom, but even with that ... we're told he feels there's nowhere for his loved ones to hide if the Nine Trey Bloods want to get even with him for snitching.

There's really no way out of this jam for Tekashi ... he's

Read more from our friends at TMZ