We analyze the thermodynamic Casimir effect occurring in a gas of non-interacting bosons confined by two parallel walls with a strongly anisotropic dispersion inherited from an underlying lattice. In the direction perpendicular to the confining walls, the standard quadratic dispersion is replaced by the term |p| α with α ⩾ 2 treated as a parameter. We derive a closed, analytical expression for the Casimir force depending on the dimensionality d and the exponent α, and analyze it for thermodynamic states in which the Bose–Einstein condensate is present. For α ∈ {4, 6, 8, …} the exponent governing the decay of the Casimir force with increasing distance between the walls becomes modified and the Casimir amplitude Δ α (d) exhibits oscillations of sign as a function of d. Otherwise, we find that Δ α (d) features singularities when viewed as a function of d and α. Recovering the known previous results for the isotropic limit α = 2 turns out to occur via a cancellation of singular terms.