Methods for altering the sequence of endogenous Drosophila melanogaster genes remain labor-intensive. We have tested a relatively simple strategy that enables the introduction of engineered mutations in the vicinity of existing P-elements. This method was used to generate useful alleles of the roX1 gene, which produces a noncoding RNA involved in dosage compensation. The desired change was first introduced into a genomic clone of roX1 and transgenic flies were generated that carry this sequence in a P-element. Targeted transposition was then used to move the P-element into roX1. Remobilization of the targeted insertion produced large numbers of offspring carrying chromosomes that had precisely introduced the engineered sequences into roX1. We postulate that this occurred by gap repair, using the P-element on the sister chromatid as template. This strategy was used to introduce six MS2 loops into the roX1 gene (roX1(MS2-6)), enabling detection of roX1 RNA by a MCP-GFP fusion protein in embryos. The roX1(MS2-6) remains under the control of the authentic promoter and within the correct genomic context, features expected to contribute to normal roX1 function. The ability to replace relatively large blocks of sequence suggests that this method will be of general use.