Recently, the number of Internet of Things (IoT) networks has been grown exponentially, which results in more data sharing between devices without appropriate security mechanisms. Since huge data management is involved, maintaining the time constraints between the devices in IoT networks is another significant issue. To address these issues, an intelligent intrusion detection system has been adapted to recognize or predict a cyber-attack using Elite Machine Learning algorithms (EML), and a lightweight protocol is used to manage the time-constrained issue. The experimental analysis of work is done on a testbed setup with the hardware and sensors connected using a lightweight Message Queue Telemetry Transport (MQTT) protocol. This comprises three parts: (i) collection of data with the help of a sensor for three different scenarios called SEN-MQTTSET; (ii) multi-context feature generation using an ensemble statistical multi-view cascade feature generation algorithm from the SEN-MQTTSET dataset; and (iii) evaluating the dataset using ML algorithms. The SEN-MQTTSET dataset has been created from the three scenarios, such as normal, attack on a subscriber, and attack on a broker. The multi-context feature is generated from the raw dataset using an ensemble statistical multi-view cascade feature generation algorithm. The EML is proposed to select the best model for intrusion detection among ML algorithms such as Logistic Regression, K-Nearest Neighbour, Random Forest, Naive Bias, Support Vector Machine, Gradient Boosting, and Decision Tree by the performance metrics such as accuracy, prediction time, F1score, and others. The proposed dataset is validated and the accuracy is found to be above 99% for the considered system model. Different quality parameters have been carried out for legitimate and attack traffic features to calculate the delay between the IoT-MQTT network.