There is an exception to the inclusion event rules that allows you to do this without penalty, but note that the deferred gain does not get wiped out due to the basis adjustment normally available to assets owned upon death. There is a special carve-out in the Opportunity Zone rules.