A loss to NC State definitely keeps them out, as they will be under .500
At least that is my understanding of the eligibility requirements. Unless something has changed this year, team are not eligible for the tournament unless they have at least a .500 record.
As for the selection of the 48 teams, there are 24 auto qualifiers and then 24 at-large selections. The at-large selections largely just follow the RPI. We are currently #23 in the RPI, so a win over NC State followed by a loss to # 2 (RPI) Wake wouldn't drop us.
So I think it is as simple as considering this NC State game as a "play in" game to the NCAA tournament. Win that and we are in, lose and we are certainly out. (Again, I could be wrong if there have been any changes to the selection process this year).
NC State is a solid team, and it will take a strong effort to beat them.
One thing that stood out to me while looking at the RPI rankings was that we have only played six home games this year. Most of the top 25 played 10 or 11. Hindsight is 20/20, but it would have been nice to get 1-2 more games at home to get one more W.