I have this working perfectly with pihole. There are other variations you could do, but this configuration has been stable for me since dnsmasq was implemented in opnsense.
Start with configuring dnsmasq with this document: https://docs.opnsense.org/manual/dnsmasq.html
Next add pihole address via dns-server [6] in dnsmasq
Point pihole upstream server to opnsense (Unbound)
DNS flow (for local domain) is client -> pihole -> Unbound (opnsense) -> dnsmasq (opnsense)
DNS flow (for internet) is client -> pihole -> Unbound (opnsense)
Start with configuring dnsmasq with this document: https://docs.opnsense.org/manual/dnsmasq.html
Next add pihole address via dns-server [6] in dnsmasq
Point pihole upstream server to opnsense (Unbound)
DNS flow (for local domain) is client -> pihole -> Unbound (opnsense) -> dnsmasq (opnsense)
DNS flow (for internet) is client -> pihole -> Unbound (opnsense)
"