Network Manager doesn't somehow requests the IP address of a name server from the router. When you connect to a network and request an IP address using DHCP — as opposed to statically configuring the IP address, default gateway, etc. yourself — the DHCP server might (but most likely will) give you the IP address of one or more DNS servers; which then can get saved into the file /etc/resolv.conf.
How can I request a name server address from CLI without changing /etc/resolv.conf, if I only know address of the gateway?
You cannot. Why would you want to do that anyway?
You can always broadcast a DHCP query on the network and await a DHCP response which most likely will contain the IP address of the known DNS servers.