Restacking x11/Xlib Window

I have a full screen top level window (application) on Solaris 10. We have a minimal window manager (DTWM), because of the critical nature of the app. On top of the first application, we have another application with a top level window, that covers the upper left area of the first application. Now, when the first top level application revceives messages as client windows, the seccond top level application (window) disappears into the background. This is standard behavior, but is it possible to squeeze the second top level window between the first top level window and its client(s) programmatically? I tried XLib's XRegonfigureWindow and XRestackWindows, but those fail.