Use Conditional Forwarding Unifi VLANS

Create an additional config file in /etc/dnsmasq.d/ and add rev-server= lines as you need.

Have a look in /etc/dnsmasq.d/01-pihole.conf for the syntax.

Restart Pi-hole by pihole restartdns