Intrusion detection systems (IDSs) face challenges in detecting rare attacks such as Remote2Local (R2L) and User2Root (U2R) due to severe class imbalance in benchmark datasets like the network security laboratory - knowledge discovery and data mining (NSL-KDD). Machine learning models struggle with low detection rates for minority classes which limit their overall effectiveness. To address this issue, we propose the CTGAN-DAE framework, which integrates a conditional tabular generative adversarial network (CTGAN) for synthetic data generation and a customized denoising autoencoder (DAE) for feature refinement and dimensionality reduction. This approach balances class distribution and improves feature representation, leading to better detection of rare attacks while maintaining accuracy for the majority classes. Experimental results from six classifiers trained with our framework demonstrate that it significantly improves IDS multi-class classification. The overall weighted F1-score was increased by an average of 9.39%. In addition, the F1-score for R2L was improved by approximately 46.59%, with a maximum gain of 63.6% compared to baseline models. Our proposed CTGAN-DAE framework consistently outperformed both baselines and synthetic minority over-sampling technique (SMOTE)-based methods in both accuracy and weighted F1-score. Although U2R detection remains challenging due to scarce real samples, CTGAN-DAE still enhances overall performance by better handling imbalanced attack classes.