Here is what your niece should have done (and still can do remotely, if need be)
What to do before you sell or give away your iPhone, iPad, or iPod touch - Apple Support
If your niece enabled Activation Lock using Find My Phone with her Apple ID, only she can remove it:
Turn off Find My iPhone Activation Lock - Apple Support
If your niece can't or won't remove the activation lock, then the device is useless to you or anyone else. You cannot do a factory reset on your own.