The rise of Internet of Things (IoT) technology has significantly enhanced several aspects of our modern life, from smart homes and cities to healthcare and industry. However, the distributed nature of IoT devices and the highly dynamic functioning of their environments introduce additional security challenges compared to conventional networks. Moreover, the datasets used to construct intrusion detection systems (IDS) are intrinsically imbalanced. Existing balancing techniques can address this issue with partially imbalanced datasets. However, their efficiency is limited when dealing with highly imbalanced datasets. Asa result, the IDS delivers a humble performance that dissatisfies the IoT-based systems requirements. Therefore, novel approaches must be investigated to address this issue. In this paper, we propose a deep learning-based approach with two-step minority classes prediction to enhance intrusion detection in IoT networks. As our main model, we employ a one-dimensional convolutional neural network (1-D CNN), which predicts network traffic with a single output for the minority classes. Additionally, another 1-D CNN is trained on these minorities, but it only performs a second prediction if the first model classifies the output as the minority group. Furthermore, we utilize the class weight technique to achieve more balance in the models' learning. We evaluated the proposed approach on the UNSW-NB15 and BoT-IoT datasets, two well-known benchmarks in building IDS for IoT networks. Compared to state-of-the-art methods, our approach revealed superior performance, achieving 80.65% and 99.99% accuracy in the multi-classification, respectively.