Decarbonising heating and cooling often focuses on electrification, with heat pumps and decentralised generation playing key roles. This transition poses economic and environmental challenges, particularly in the production, operation, and disposal of these systems. However, greenhouse gas emissions from heating and cooling equipment are often overlooked. This study evaluates whether fifth-generation district heating and cooling (5GDHC) systems offer a better alternative to traditional heat pumps and chillers for electrifying heating and cooling in buildings. We introduce a framework to compare the performance of 5GDHC systems with traditional alternatives, focusing on engineering, economic, and environmental aspects. The framework uses linear programming, cradle-to-grave life cycle assessment, and a global sensitivity analysis to support decision-making under uncertainty. It is applied to five case studies: Brisbane, Melbourne, New York City, Paris, and Singapore, under three scenarios: current trends, and slow and rapid electrification aiming for net zero by 2050 and 2040. Results show that 5GDHC systems can reduce annualised costs, which include capital and operational costs, by up to 26% and GHG emissions by up to 21%, with self-sufficiency rates up to 98%. This framework aids planners and policymakers in making informed decisions for sustainable urban energy solutions, emphasising the importance of an early, holistic assessment.