The frequency response of a photovoltaic (PV) system integrated power grid is severely hampered due to inadequate inertial support. Integrating a battery energy storage system (BESS) can assist in maintaining frequency response by providing a rapid injection of active power into the grid. Nevertheless, instead of typical constant droop settings enabled in BESS, adopting variable PV power dependent operation of BESS can ensure frequency stability with reduced injection, especially in PV-integrated grids. From this viewpoint, this paper proposes a novel frequency control approach of BESS depending on the available PV power in the grid. A gradient descent-based optimization is utilized to evaluate the required maximum injection from the installed BESS to maintain frequency response under different PV generation values. This approach is then tested by modifying the BESS frequency controller to keep the active power dispatch from BESS within the calculated value under a given outage. The whole methodology is analyzed in a customized IEEE 39 bus New England System under different PV penetration and generation scenarios. The results indicate successful convergence to optimal dispatch levels for the BESS across all evaluated scenarios. As PV generation increases, the optimal BESS dispatch as a percentage of rated PV output declines gradually. However, at lower PV generation, this value rises rapidly and reaches the installed BESS capacity. Later, the applicability of the methodology is validated by comparing the simulated outputs with different test grid network and another support technique- Synchronous Condenser (SC). From the standpoint of frequency stability, the proposed technique can assist the grid planners in regulating BESS operations in a renewable integrated grid more effectively.