Assuming that the contribution took place during the marriage, the non-vested portion is still probably considered marital property and subject to division. Contributions by you or your employer either before the marriage or after the date of separation are probably your separate property.
One way to handle it would be to offset the value of the non-vested portion with other assets--so you keep the whole 401(k) and give your ex some other property of equal value (but keep in mind that the 401(k) money will be subject to tax in the future).
Another way would be to write up a QDRO that divides the account and instructs the plan administrator to pay the appropriate share to your ex when it becomes eligible for distribution.
You'll probably want some help from a lawyer and a financial/QDRO expert to get it all correct.
Edited by TJMH (06/19/17 10:25 PM)