Context.Pebble accretion is among the major theories of planet formation. Aerodynamically small particles, called pebbles, are highly affected by the gas flow. A growing planet embedded in a protoplanetary disk induces three-dimensional (3D) gas flow. In our previous work, Paper I, we focused on the shear regime of pebble accretion and investigated the influence of planet-induced gas flow on pebble accretion. In Paper I, we found that pebble accretion is inefficient in the planet-induced gas flow compared to that of the unperturbed flow, particularly when St ≲ 10−3, where St is the Stokes number.Aims.Following on the findings of Paper I, we investigate the influence of planet-induced gas flow on pebble accretion. We did not consider the headwind of the gas in Paper I. Here, we extend our study to the headwind regime of pebble accretion.Methods.Assuming a nonisothermal, inviscid sub-Keplerian gas disk, we performed 3D hydrodynamical simulations on the spherical polar grid hosting a planet with the dimensionless mass,m=RBondi∕H, located at its center, whereRBondiandHare the Bondi radius and the disk scale height, respectively. We then numerically integrated the equation of motion for pebbles in 3D using hydrodynamical simulation data.Results.We first divided the planet-induced gas flow into two regimes: flow-shear and flow-headwind. In the flow-shear regime, where the planet-induced gas flow has a vertically rotational symmetric structure, we find that the outcome is identical to what we obtained in Paper I. In the flow-headwind regime, the strong headwind of the gas breaks the symmetric structure of the planet-induced gas flow. In the flow-headwind regime, we find that the trajectories of pebbles with St ≲ 10−3in the planet-induced gas flow differ significantly from those of the unperturbed flow. The recycling flow, where gas from the disk enters the gravitational sphere at low latitudes and exits at high latitudes, gathers pebbles around the planet. We derive the flow transition mass analytically,mt, flow, which discriminates between the flow-headwind and flow-shear regimes. From the relation betweenm,mt, flowandmt, peb, wheremt, pebis the transition mass of the accretion regime of pebbles, we classify the results obtained in both Paper I and this study into four groups. In particular, only when the Stokes gas drag law is adopted andm< min(mt, peb,mt, flow), where the accretion and flow regime are both in the headwind regime, the accretion probability of pebbles with St ≲ 10−3is enhanced in the planet-induced gas flow compared to that of the unperturbed flow.Conclusions.Combining our results with the spacial variety of turbulence strength and pebble size in a disk, we conclude that the planet-induced gas flow still allows for pebble accretion in the early stage of planet formation. The suppression of pebble accretion due to the planet-induced gas flow occurs only in the late stage of planet formation, more specifically, in the inner region of the disk. This may be helpful for explaining the distribution of exoplanets and the architecture of the Solar System, both of which have small inner and large outer planets.