We draw a parallel between the BV/BRST formalism for higher-dimensional (≥ 2) Hamiltonian mechanics and higher notions of torsion and basic curvature tensors for generalized connections in specific Lie n-algebroids based on homotopy Poisson structures. The gauge systems we consider include Poisson sigma models in any dimension and “generalised R-flux” deformations thereof, such as models with an (n + 2)-form-twisted R-Poisson target space. Their BV/BRST action includes interaction terms among the fields, ghosts and antifields whose coefficients acquire a geometric meaning by considering twisted Koszul multibrackets that endow the target space with a structure that we call a gapped almost Lie n-algebroid. Studying covariant derivatives along n-forms, we define suitable polytorsion and basic polycurvature tensors and identify them with the interaction coefficients in the gauge theory, thus relating models for topological n-branes to differential geometry on Lie n-algebroids.