Craig Mack knew he was dying, at least for several months, from congestive heart failure ... according to his close friend, Erick Sermon.
The '90s MC broke the news Tuesday -- hours after Craig passed away in South Carolina -- telling us the "Flava in Ya Ear" rapper had only 25% of his heart working in his final months.
As we reported, the coroner would only say Craig had died of natural causes ... so, Sermon, shed more light on Craig's final days. He says the Bad Boy Records pioneer had called his closest friends -- including Erick and Biz Markie -- 6 months ago to tell them what he was battling, but didn't want them to see him in his frail condition.
Erick says Craig maintained his personality, though ... they eventually hooked up and even recorded some music, and shot a documentary before he died.