In my limited xperience in that area , I think that the difficult bit is buying a car in Algeria . Not sure about the process but I guess Its gonna be really difficult . For example , in Morocco is not possible to buy a Moroccan registered car and exit the country with it .
Regarding Niger ,theres' absolutely nothing to stop you selling /giving away the car. Your car is not written on your passport , so you are free to exit the country with or without your car . (as opposed to -say- Mauritania) . However the new owner should probbably pay duty for the car even that is a donation/NGO ,etc.