We generalize basic results relating the associated graded Lie algebra and the holonomy Lie algebra from finitely presented, commutator-relators groups to arbitrary finitely presented groups. In the process, we give an explicit formula for the cup-product in the cohomology of a finite 2-complex, and an algorithm for computing the corresponding holonomy Lie algebra, using a Magnus expansion method. We illustrate our approach with examples drawn from a variety of group-theoretic and topological contexts, such as link groups, one-relator groups, and fundamental groups of Seifert fibered manifolds.