Suppose we have an infinitesimal process in which reactants are converted to products. Let the variables $N_i$ represent the particle numbers of each of these molecule types, and the energy and volume of the system are given by $E$ and $V$ respectively. Then the entropy of the system is given by $S=S(E,V,N_1,...,N_m)$ and the change in entropy in a quasistatic process is given by a first-order expansion which gives, on using standard definitions for the various partial derivatives $$dS=\frac{1}{T}dE+\frac{p}{T}dV-\sum\frac{\mu_i}{T}dN_i$$ However we also have $TdS=dQ$, so $$dQ=dE+pdV-\sum\mu_idN_i$$ But $\sum\mu_idN_i \neq0$ in general as far as I can tell, so how is the statement given in the title of my question (which is also on page 325 of the textbook by Reif) true (i.e. $dQ \neq dE$)? Indeed, it seems this is only true at equilibrium, where $\sum\mu_idN_i =0$.
Edit: I should mention that, intuitively, I expect the statement in my title to be true. In particular, since the system is at constant volume and since the chemical reaction is internal to the system (closed system), the only way that the surroundings can interact with the system is via thermal interaction. A possible analogy is a composite system of two containers of gas at different pressure, with a piston between them held fixed initially. Once the piston is released, the pressures will equilibrate; certainly, the composite system now has a higher entropy, entropy which was generated (if we calculate via some imagined quasistatic process) by heat transfer. What is relevant in this analogy to the case I give is the fact that the volumes $V_1$ and $V_2$ of the two containers do not appear in the composite system expression $TdS=dQ$. The mapping between the analogy and my question would be $V_i \to N_i$ because they are ostensibly both "internal" to the overall, composite system. They describe states of internal subsystems if you will.
A further edit: It seems to me that this may have something to do with chemical reactions being nonquasistatic (except in the particular case of us being right at chemical equilibrium), and $dQ=TdS$ therefore not holding (i.e. it's an internal process akin to nonquasistatic volume expansion of gas, so there is an extra, nonquasistatic component of entropy generation). Not sure how this helps me or if it's true at all, but it's something that came to mind.