For a graph $G=(V, E)$ and an edge $uv\in E(G)$, the $2$-neighborhood of $uv$ is the set of all edges having at least one endvertex in $N(u)\cup N(v)$. A graph is called $P_5$-free if it contains no induced subgraphs isomorphic to a path with 5 vertices. For $P_5$-free graphs, we show that the maximum cardinality of an edge 2-neighborhood is at most $\frac{5\Delta^2}{4}$, where $\Delta$ is the maximum degree of graphs. When $\Delta$ is even, this bound is tight and we confirms the strong edge-coloring conjecture posed by Erd\H{o}s and Ne\v{s}et\v{r}il for $P_5$-free graphs.