At a high level, you would need to enumerate all open file handles (or rather all open handles, then filter out everything except the file handles) and then look for any file handles whose object name matches the mapped network drive's device name.
It's a lot of low-level Win32 APIs (NtQuerySystemInformation, NtQueryInformationFile, NtQueryObject, etc) but it's definitely doable. If you're going down this road, I would recommend picking up a copy of Windows Internals plus scouring MSDN and Mark Russinovich's blog.
I don't think it's the type of thing you'll get a complete answer to on here, unless perhaps there's an open source project already doing it which can be linked to. For instance, the source for the Sysinternals tools used to be freely available, and can still be found, like this v4.3x version of the FileMon source, which may shed some light.