Near-isogenic lines (NILs) are a valuable resource for detecting linkages between qualitative trait loci and molecular markers. Molecular marker studies are expensive and methods that require genotyping fewer individuals, such as the NIL-analysis method, are desirable. We present a theory for using sets of NILs to detect linkages between molecular markers and introgressed loci. The probability that a marker a specific distance from the introgressed gene will have a donor parent allele in a near-isogenic line is a function of the distance between the marker and the gene, and the number of back-crosses and/or selfs used in deriving the NIL. The binomial probability formula is used to calculate the probability of having a donor parent allele at a given marker when sets of NILs are used. The formulae given allow calculation of the probability that a marker is linked to the introgressed gene, as well as the probability that a gene will be successfully detected when using given numbers of NILs, backcrosses, and molecular markers.