For a homogeneous random walk in the quarter plane with nearest-neighbor transitions, starting from some state $(i_0,j_0)$, we study the event that the walk reaches the vertical axis, before reaching the horizontal axis. We derive an exact expression for the probability of this event, and derive an asymptotic expression for the case when $i_0$ becomes large, a situation in which the event becomes highly unlikely. The exact expression follows from the solution of a boundary value problem and is in terms of an integral that involves a conformal gluing function. The asymptotic expression follows from the asymptotic evaluation of this integral. Our results find applications in a model for nucleosome shifting, the voter model and the asymmetric exclusion process.