PKCS#7 format is binary, DER encoded.
NDigitSign generates PKCS#7 DER encoded (binary)
When you see a file that starts with
-------BEGIN PKCS7 ---------
It is in PEM format that is, base64 encoded PKCS#7 DER encoded.
In other words the binary PKCS#7 (DER encoded) is converted in base64 and a line like
-------BEGIN PKCS7 ---------
is added at the beginning of the file and a line like
-------END PKCS7 ---------
is added at the end of the file.
To generate a PEM file from the PKCS#7 supplied by NDigitSign convert the PKCS#7 in base64 and add the two lines above.
Please, to understand what I said, read PKCS#7 specifications, ASN1 DER encoding rules and PEM encoding rules.