How to batch copy "date modified" from files in directory to other files with identical names (but compressed) in another directory?

Using the command line program, exiftool, you would use this command
exiftool -TagsFromFile /path/to/sourceFiles/%F -All:All -FileModifyDate -FileCreateDate /Path/to/NewFiles/

This will copy all embedded tags that exiftool can copy as well as the system timestamps from the /path/to/sourceFiles/ directory to files with the exact same name in the /Path/to/NewFiles/ directory.

This command creates backup files. Add -overwrite_original to suppress the creation of backup files.