You can think of it in this situation as a "secondary dominant". Meaning
that, if you think of the Dm7 to G7 progression as just G7 (they're
basically the same thing), the D13 chord is basically the V chord of the
G7. Also referred to as "tonicsization" (sp?), meaning you momentarily
think of the G7 chord as the home base, or I chord, and approach it with
it's dominant V chord, which is D7 (or D13, or whatever). You'll hear many
people, both soloists, and harmony-playing instruments, often insert a
secondary dominant into normal ii-V progressions, eg. Bbm7 Eb7 Abmaj7
becomes Bb7#11 Eb7 Abmaj7. See "A Train", and hundreds of other tunes for
examples.
(Also, the "secondary dominant takes the #11", as an old teacher used to
recite. Although, now that I think of it, I can't think of why that would
be, theoretically, rather than just being a regular mixolydian dominant.
Of course, it *sounds* right, so what more do you need.)
Dan.
Central Park North
http://www.geocities.com/BourbonStreet/5580
"The farther North you go, the more intense the music gets..."
-Paul Bley