There are so many options available when using that particular 'chord sequence'. You could have easily included an F♯ and it would have a different sound. Try it.
With the information you have given, there's insufficient. Saying 'the A minor scale notes' narrows things down a little - but not enough. There are three main A minor scales - natural - A B C D E F G, melodic - A B C D E F♯ G♯, and harmonic - A B C D E F G♯. All slightly different in the notes used, therefore the feel given.
Then there are a couple of minor modes _ A Dorian - A B C D E F♯ G, and A Phrygian - A B♭ C D E F G. Called minor as they possess m3 above their roots.
You could have used pretty well any of those 'scales' as your bank of notes - and each one would give a different feel. That's before we venture into D Mixolydian - which also happens to contain D A C G (your ostinato notes). D Mix. gives a major feel to it all, with a tinge of Blues. The Beatles used it in several songs.
Hopefully, given this 'explanation of a rule' you'll have more ideas that you can use. The main one always being 'if it sounds good...', but when you try out my other suggestions, you may realise there's not only one 'sounds good'.
And finally, my students are all aware that any note, at any time in any piece, in any key will fit - once they know what they're doing..! Maybe that's the 'rule'?