If you are not using Filevault on it, then either put the G5 into Target Disk Mode or remove the hard drive and use a USB hard drive dock to connect it to your other Mac. I've seen some reports that newer versions of macOS may not be able to mount the old style partition & file system used on a PPC Mac.
Unfortunately you need the Snow Leopard DVD since it includes a password reset utility on it.
What you may be able to do is see if you can create a new admin user account. The easiest way to do this is by booting into Single User Mode by using Command + S just after the startup chime (assuming this is available with OSX 10.6 on a G5). Once you boot to the command prompt follow the directions listed on the screen to run the file system check and remount the root file system as read + write.
fsck -fy
mount -uw /
Once this is done you need to delete a file so that when you reboot the Mac it will force OSX to run Setup Assistant again where it will create a new admin user account for you.
rm -i /var/db/.AppleSetupDone
reboot
You will be prompted to confirm that you want to delete this file. Type "y' for "yes" or "n" for "no" followed by pressing the "Return" key to submit the response.
If the ".AppleSetupDone" file is successfully deleted, then when you reboot the Mac you should be greeted by Setup Assistant. Once you create the new admin user you can go into the "Users & Groups" System Preferences and change the password on the old user account.