The ability to determine polymer elasticity and force-extension relations from polymer dynamics in flow has been challenging, mainly due to difficulties in relating equilibrium properties such as free energy to far-from-equilibrium processes. In this work, we determine polymer elasticity from the dynamic properties of polymer chains in fluid flow using recent advances in statistical mechanics. In this way, we obtain the force-extension relation for DNA from single molecule measurements of polymer dynamics in flow without the need for optical tweezers or bead tethers. We further employ simulations to demonstrate the practicality and applicability of this approach to the dynamics of complex fluids. We investigate the effects of flow type on this analysis method, and we develop scaling laws to relate the work relation to bulk polymer viscometric functions. Taken together, our results show that nonequilibrium work relations can play a key role in the analysis of soft material dynamics.