For a homogeneous random walk in the quarter plane with nearest-neighbor transitions, starting from some state (i0,j0), we study the event that the walk reaches the vertical axis, before reaching the horizontal axis. We derive a certain integral representation for the probability of this event, and an asymptotic expression for the case when i0 becomes large, a situation in which the event becomes highly unlikely. The integral representation follows from the solution of a boundary value problem and 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.