The objective of using ensemble methods when detecting Denial-of-Service (DoS) attacks in Network Intrusion Detection Systems (NIDS) is to improve the accuracy and reliability of the detection process. Ensemble methods involve combining multiple machine learning models to create a more robust and accurate prediction model.