You don't need to sell/give the assets away to allow the for-profit to use them.
You sign an exclusive, non-revocable licensing agreement. Ownership of the original IP remains 100% with the original startup.
Now, this only works if the non-profit's board is on-board.