The OS doens't allow that out of the box (neither for dmg nor real partitions).
What I would do is create a script that would listen to that mounted image and after x time idle, unmount it.
Applescript is a fairly simple way to get that working (or via an automator flow).
(the tricky part is getting the disk image idle)
Checking for folder/file changes using Automator?
How to run Applescript on Disk mount
Automatically launch a program or action when an external drive or disk is connected
I'll make an example later today, but the flow will be like this:
drag mounted image disk to it
monitor this disk access (every x time, to save processor)
if last time accessed > idlelimit then