Network Intrusion Detection Systems (NIDS) play a vital role in identifying malicious behavior in high-speed network traffic, but their effectiveness is generally hindered by high-dimensional data, redundant features, and the dynamic nature of cyber threats. To overcome these challenges, this paper proposes a novel hybrid approach that combines Teaching–Learning-Based Optimization (TLBO) for feature selection with a Grasshopper Optimization Algorithm (GOA)-optimized Multi-Layer Perceptron (MLP) classifier. The key to the proposed method’s effectiveness is its sequential optimization approach, wherein TLBO is first used to identify an optimal and minimal subset of informative features from the NSL-KDD and CIC-IDS-2017 datasets. Subsequently, the GOA is used to optimize the MLP’s weights and hyperparameters, enhancing the classification accuracy and generalization capability on the feature-reduced space. The stratified 80:20 train-test split is employed to maintain class balance, and macro-averaged evaluation metrics are used to provide a fair comparison for all classes of attacks. The experimental outcome clearly shows that the proposed TLBO-GOA-MLP approach outperforms the MLP and other competing classifiers, with a multi-class classification accuracy, precision, recall, and F1-score of over 98% on both datasets, making it an ideal candidate for near real-time intrusion detection with significantly lower computational complexity due to the feature-reduced space.