The aim of this paper is to study class number relations over function fields and the intersections of Hirzebruch-Zagier type divisors on the Drinfeld-Stuhler modular surfaces. The main bridge is a particular harmonic theta series with nebentypus. Using the strong approximation theorem, the Fourier coefficients of this series are expressed in two ways; one comes from modified Hurwitz class numbers and another gives the intersection numbers in question. An elaboration of this approach enables us to interpret these class numbers as a mass sum over the CM points on the Drinfeld-Stuhler modular curves, and even realize the generating function as a metaplectic automorphic form.