As per the below blog, dynamic headers will be passed to second ICo.
SP4 Released: B2B Add-On and Secure Connectivity Add-On
So did you try just enabling ASMA in your file sender and receiver?
Routing of Dynamic headers
All the present dynamic headers (except set by SAP EDI and TPM modules) will be routed to next ICOs after message processing by EDI Seperator Receiver channel. Example: If you have filename as dynamic header set by AS2 or SFTP adapter in first ICO's XI message, these dynamic headers will be passed to next ICO (XI Message) along with splitted/routed messages.