You can go into the admin areas of your router to see the devices that are connected. There you will see the IP address of each device.
The problem is, if you can't set the IP address manually on the device, its IP address is subject to change. It doesn't change often, but it can change, because it is not fixed.
The current IP address may allow you to find it from your iPhone or iMAC, which then may allow you to get other information about it, thereby allowing you to establish a connection to it from your iPhone and iMac.
I have a Canon Selphy; I can print to it either via direct wireless or via the router. But I have to set the printer one way or the other; I can't leave it in both modes at the same time. If your printer allows you to leave it in both modes at the same time, then you could likely print to it via direct wireless.
The way my Selphy does direct wireless is, it sets up the printer as a wifi hotspot; I then attach to that hotspot from my iPhone, allowing me to print to it from my iPhone. Whenever I connect to the printer in that way, it drops whatever other wifi connection it has established, which means that I don't have wifi calling or wifi data whenever my iPhone is connected to the printer.