The labels for the two sides of the division need to match exactly.
If they match 1:1 except for additional labels, then you can use
xxx / on (foo,bar) yyy # foo,bar are the matching labels
or
xxx / ignoring (baz,qux) zzz # baz,qux are the labels to ignore
If they match N:1 then you need to use group_left or group_right.
If you show the results of the two halves of the query separately then we can be more specific. That is:
sum(kafka_consumergroup_lag{cluster=~"$cluster",consumergroup=~"$consumergroup",topic=~"$topic"}) by (consumergroup, topic)
count(up{job="prometheus.scrape.kafka_exporter"})