Commercial wastewater treatment via eco-friendly routes are highly appreciated as a sustainable solution as per the United Nation’s Sustainable Development Goal 6 (UNSDG-6). Here, we report a cost-effective and efficient route to treat wastewater by photocatalysis using sunlight. Hydrothermally-synthesized MoS2-ZnS nanocomposite is used as photocatalyst and methylene blue (MB) and rhodamine B (RhB) are used as model dyes to study the photocatalytic degradation activity. After exposure to sunlight for a period of 60 minutes, the MoS2-ZnS nanocomposite shows a degradation of 98.29 and 93.01% for MB and RhB, respectively. This enhanced photocatalytic activity of the MoS2-ZnS nanocomposite is due to its high light absorption and lower electron-hole recombination for the degradation of dyes. No harmful by-products are formed, which shows the eco-friendly nature of photocatalytic degradation of dyes in wastewater. A detailed theoretical investigation is carried out using density functional theory analysis performed for dyes and the photocatalysts in order to understand the mechanism behind the degradation. A good correlation between the calculated and experimental data is observed. This study proclaims that MoS2-ZnS nanocomposite is a cost-effective and efficient photocatalyst among other costly layered two-dimensional nanocomposites.