Natural gas is an environmentally friendly energy source that significantly reduces unburned hydrocarbons and NOx compared to traditional fuel (such as HFO, MGO, etc.) in low speed two-stroke marine engines. However, low-pressure injection dual-fuel engines tend to experience detonation under high load circumstances, thereby restricting the power output of the engine. The factors contributing to detonation in dual-fuel engines are more complex compared to conventional engines. This paper intends to investigate the potential mechanism that leads to the in-cylinder detonation phenomenon in natural gas-diesel dual-fuel marine engines and to search for approaches to improve the in-cylinder pressure oscillations. The numerical simulation outcomes reveal that decreasing the mass of pilot diesel fuel (from 227mg to 75.6mg) and the equivalent ratio (from 0.51 to 0.42) can effectively control the combustion rate and the combustion intensity of the flame front, thus attaining the goal of improving the cylinder pressure fluctuation. Moreover, appropriately enhancing swirl flow can alter the shape of the flame front which can restrain the pressure oscillation within the cylinder. As a consequence, the shape of the flame front is also a crucial factor affecting the pressure oscillation. Eventually, the pressure oscillation can be decreased to lower than 0.1 MPa and it is feasible to increase the power of dual-fuel engine (from 950.16 KW to 1142.85 KW) by raising the natural gas fuel (from 22.1mg to 22.69 mg).