I’ve seen a few posts over the years about VLANs. I just went through figuring this out, and thought I’d share that. I have a Mikrotik router with a separate Ubuiqiti access point. The main WLAN connection comes out untagged, and the guest network is VLAN 10 (I know, I should have everything VLAN’d, but haven’t gotten around to that). Raspbian recently changed how you configure the network, so this is the best resource I’ve found for setting up VLANs on the rPi:
The only other step is to make sure you go into Pihole settings (DNS tab), and tick “Listen on all interfaces”. Since I have a separate subnet for the VLAN, it’s easy to look in the query log to see it working.