This image did originate with NASA, as is claimed in the caption for this image — but this is not a genuine photograph taken from a spacecraft orbiting Earth, but a screenshot from an animation about how the earth's magnetic field causes auroras to form. It was created in 2005 by lead animator Walt Feimer and the NASA/Goddard Space Flight Center Conceptual Image Lab as part of the "Live from the Aurora" series of conceptual animations.
The official NASA video can be viewed here. A copy from YouTube is embedded below:
Join a ride with electrons along the Earth's magnetic field line to the formation site of the aurora.
Harmonic produced this show exclusively for NASA TV UHD, using time-lapses shot from the International Space Station, showing both the Aurora Borealis and Aurora Australis phenomena that occur when electrically charged electrons and protons in the Earth's magnetic field collide with neutral atoms in the upper atmosphere.
Another NASA video provides additional information: