This study focuses on the numerical analysis of a piping structure subjected to the water-hammer event caused by a rapid valve closure that is combined with external harmonic loading representing an idealized machine excitation. The fluid-structure interaction procedure applied to solutions involves the method of characteristic for the fluid equations with the finite element method for pipe structures, which are modeled as beams. Junction coupling at the pipe elbow governs the two-way coupled fluid-structure interaction, and both the friction and Poisson couplings are incorporated as well. There is an application on a piping structure that consists of a valve, tank, and elbow that are defined as boundary conditions. The solved result quantities include pressure and bending stress responses as well as dynamic displacement modes of the piping structure. Comparisons of the results show that water hammer loading combined with the mechanical excitation load induces significantly increased displacements and higher stress peaks when frequencies of the harmonic load and the acoustic natural mode of the piping system coincide. Additionally, the resulting mode of lateral structural vibration of the piping member closely resembles an analytically solved eigenmode of the beam. The conclusion is that dynamically changing flows due to a water hammer event can solely excite natural frequencies of the piping structure causing resonance in the system.