Content-based image retrieval (CBIR) systems are designed to retrieve images that are relevant, based on detailed analysis of latent image characteristics, thus eliminating the dependency of natural language tags, text descriptions, or keywords associated with the images. A CBIR system maintains high-level image visuals in the form of feature vectors, which the retrieval engine leverages for similarity-based matching and ranking for a given query image. In this paper, a CBIR system is proposed for the retrieval of medical images (CBMIR) for enabling the early detection and classification of lung diseases based on lung X-ray images. The proposed CBMIR system is built on the predictive power of deep neural models for the identification and classification of disease-specific features using transfer learning based models trained on standard COVID-19 Chest X-ray image datasets. Experimental evaluation on the standard dataset revealed that the proposed approach achieved an improvement of 49.71% in terms of precision, averaging across various distance metrics. Also, an improvement of 26.55% was observed in the area under precision-recall curve (AUPRC) values across all subclasses.