A court has heard how only “a miracle” prevented people being injured when a teenage danger driver led police on a five-minute chase through a busy built-up area.