The 5 just means five steps above the root. Like you said a D5, count up five notes D, E, F, G, A. So the fifth above D is A. Placed together as a chord it would be D5. The chord would look like this.
E:----- B:----- G:--7-- <- octave of root D:--7-- <- the fifth A A:--5-- <- the root D E:-----
"My whole life is a dark room...ONE BIG DARK ROOM" - a.f.i.