This would allow your router to by-pass Pi-hole via 8.8.8.8 at its own discretion.
Furthermore, some Unifi equipment may filter DNS itself, see Whitelisted items are still blocked! - #15 by Sawtaytoes.
Also, you are configuring your router's upstream server.
While that would allow Pi-hole to filter DNS on your network, you won't be able to attribute DNS requests to individual client IPs, as all requests would originate from your router.
It would be preferred if you can configure your Pi-hole as the local DNS server your router hands out to its clients. Depending on your Unifi equipment, you may be able to take advantage of Ubiquiti USG - Pi-hole documentation.