When you get a NDE you get an impression of your pending death and impermanence of life. Because of this impression you perhaps may get the benefits of contemplating on death.

> mindfulness is established on death as the object,

> the mental hindrances are suppressed,

> the dhyana-factors appear.

> ...

> And,a monk devoted to this mindfulness of death, is constantly diligent.

> He gains the perception of non-delight in all existence. 

> He abandons longing for life. 

> He is one who censures the bad. 

> He is not one who stores up much. 

> He is free from the taint of avarice. 

> And the perception of impermanence grows in him. 

Source: [Maraṇa Sati Kathā][1] by Piya Tan

Nearing the point of death you are get sign of the a Kamma you have performed. Sometimes what you see is a sign of what you did maybe the person involved. This explains seeing dead relatives. Also you will see signs of where you will be reborn. If you like or dislikes  a person, or the person owes you something and you are destined to be born near where the person is born then you might again see such people. These are in most cases signs and you are not really seeing the being. For more information on the process nearing the death of a being see the section The mind at the time of death in [The Abhidhamma in Practice][2] by N.K.G. Mendis.

If the Karma that has come up at the point of death is of positive nature you might get positive looking signs like lights, angels, etc.

NDE is very rare experience but the same benefits can be reaped from contemplation of death. See my answers on this topic: [How do I do “contemplation of death” meditation? And is it dangerous?][3], [Is contemplation of death auto-suggestion?][4]


  [1]: http://dharmafarer.org/wordpress/wp-content/uploads/2013/04/48.14-Maranasatikatha-vism7-piya.pdf
  [2]: http://www.accesstoinsight.org/lib/authors/mendis/wheel322.html
  [3]: http://buddhism.stackexchange.com/a/14365/295
  [4]: http://buddhism.stackexchange.com/a/14387/295