The energy harvesting potential of flexible structures (e.g. flags) made of piezoelectric materials has drawn rapidly increasing attention in recent years. In this work, we numerically study the energy harvesting performance of an inverted piezoelectric flag in an oscillating flow using an immersed boundary-lattice Boltzmann method for Reynolds number of 100, mass ratio of 2.9 and non-dimensional bending stiffness of 0.26 which correspond to the maximum flapping amplitude for a single inverted flag in a uniform flow. 2D simulations are conducted by varying the ellipticity (e), the ratio R of the frequency of the oscillating flow to the fundamental natural frequency of the flag and the horizontal velocity amplitude (Au) of the flow. Three coupling regimes at Au = 0.5 are identified: chaotic oscillations regime I (0.1 < R < 1 ), large periodic and symmetric oscillation regime IIa (1.1 < R < 1.5) and IIb(2.1 < R < 3.0), and small periodic and asymmetric oscillation regime III(1.6 < R < 2). The maximum mean electrical power coefficient CP occurs in regime IIa at R = 1.5 with Au = 0.5, alpha (piezo-mechanical coupling parameter) = 0.5, and beta (piezo-electric tuning parameter) = 1.5. CP is 0.10 for a single inverted flag, and is 148%, higher than that of the corresponding flag in the uniform flow. This improvement is attributed to the higher flapping angular amplitude (180 degrees), higher ratio of the flapping frequency to the oscillating frequency (virtually constant at 0.5) of the flags, and constructive vortex interaction in regime IIa.(c) 2022 Elsevier Ltd. All rights reserved.