Extant enzymes are not only highly efficient biocatalysts for a single, or a group of chemically closely related substrates but often have retained, as a mark of their evolutionary history, a certain degree of substrate ambiguity. We have exploited the substrate ambiguity of the ectoine hydroxylase (EctD), a member of the non-heme Fe(II)-containing and 2-oxoglutarate-dependent dioxygenase superfamily, for such a task. Naturally, the EctD enzyme performs a precise regio- and stereoselective hydroxylation of the ubiquitous stress protectant and chemical chaperone ectoine (possessing a six-membered pyrimidine ring structure) to yield trans-5-hydroxyectoine. Using a synthetic ectoine derivative, homoectoine, which possesses an expanded seven-membered diazepine ring structure, we were able to selectively generate, both in vitro and in vivo, trans-5-hydroxyhomoectoine. For this transformation, we specifically used the EctD enzyme from Pseudomonas stutzeri in a whole cell biocatalyst approach, as this enzyme exhibits high catalytic efficiency not only for its natural substrate ectoine but also for homoectoine. Molecular docking approaches with the crystal structure of the Sphingopyxis alaskensis EctD protein predicted the formation of trans-5-hydroxyhomoectoine, a stereochemical configuration that we experimentally verified by nuclear-magnetic resonance spectroscopy. An Escherichia coli cell factory expressing the P. stutzeri ectD gene from a synthetic promoter imported homoectoine via the ProU and ProP compatible solute transporters, hydroxylated it, and secreted the formed trans-5-hydroxyhomoectoine, independent from all currently known mechanosensitive channels, into the growth medium from which it could be purified by high-pressure liquid chromatography.