Thanks Amir, that was exactly it. I had somewhat misunderstood the concept of elements.
For the record, besides changing to add the extra nfs-export-host element, I also had to add "is-readwrite-for-all-hosts" and set it to false, as well as adding "nfs-security-flavors"-element. See below:
my $nfsexportelem = NaElement->new("dataset-nfs-export-setting");
According to the NMSDK4.1 documentation, "is-readwrite-for-all-hosts" should default to "false", and "nfs-security-flavor" should default to "sys", but that has not been my experience. I have not been able to verify this in the NMSDK5.0 documentation
But adding them, together with the "nfs-export-host" element makes everything behave as expected. Thanks again!