In the evolving field of Content-Based Image Retrieval (CBIR), we introduce a novel approach that integrates deep learning models—NASNetMobile, DenseNet121, and VGG16—with ensemble methods to enhance retrieval accuracy and relevance. This study uniquely combines NASNetMobile's adaptability, DenseNet121's feature extraction, and VGG16's robustness through hard and soft voting techniques, aiming to effectively bridge the semantic gap in CBIR systems. Our comparative analysis against existing CBIR algorithms using diverse online datasets demonstrates superior performance, with our approach achieving up to 98% in accuracy, precision, recall, and F1-score, thereby redefining performance benchmarks. This advancement proves particularly impactful in medical imaging and surveillance, where precise image retrieval is crucial. Our research contributes to CBIR by (1) demonstrating the integrated deep learning ensemble's ability to narrow the semantic gap and (2) providing a comparative performance analysis, underscoring our method's improvement over current technologies. The combination of these models marks a significant step forward in CBIR, offering a more accurate and efficient solution for image retrieval challenges.