The thing to remember here is that OSPF does not put routers into areas, but networks. This seems a fine distinction, but is actually quite important here. You should also remember that OSPF does not have stub networks, it has stub areas.
So, on all your routers, put the links of that ABCD loop into area 0. On router D, put the 10.5.0.0/30 link into area 1; network 10.5.0.0 0.0.0.3 area 1. Then do area 1 stub. Router D becomes a border router between your stub area 1 and the backbone.
Router E end of that link should also be in area 1, and area 1 declared as stub. If you want area 1 to contain only the default route, then router D should have area 1 stub no-summary. It will then inject a default route into the area 1, which router E will pick up. The "no-summary" is only necessary on the area border router (D).
Kevin Dorrell
Luxembourg