Yes, a valid passport is required for travel from the UK to Gibraltar. Gibraltar is a British Overseas Territory but is not part of the UK.