Near a quantum-critical point, a metal reveals two competing tendencies: destruction of fermionic coherence and attraction in one or more pairing channels. We analyze the competition within Eliashberg theory for a class of quantum-critical models with an effective dynamical electron-electron interaction V (Ωm) ∝ 1/|Ωm| γ (the γ-model) for 0 < γ < 1. We argue that the two tendencies are comparable in strength, yet the one towards pairing is stronger, and the ground state is a superconductor. We show, however, that there exist two distinct regimes of system behavior below the onset temperature of the pairing Tp. In the range Tcross < T < Tp fermions remain incoherent and the spectral function A(k, ω) and the density of states N (ω) both display "gap filling" behavior in which, e.g., the position of the maximum in N (ω) is set by temperature rather than the pairing gap. At lower T < Tcross, fermions acquire coherence, and A(k, ω) and N (ω) display conventional "gap closing" behavior, when the peak position in N (ω) scales with the gap and shifts to a smaller value as T increases. We argue that the existence of the two regimes comes about because of special behavior of fermions with frequencies ω = ±πT along the Matsubara axis. Specifically, for these fermions, the component of the self-energy, which competes with the pairing, vanishes in the normal state. We further argue that the crossover at T ∼ Tcross comes about because Eliashberg equations allow an infinite number of topologically distinct solutions for the onset temperature of the pairing within the same gap symmetry. Only one solution, with the highest Tp, actually emerges, but other solutions are generated and modify the form of the gap function at T ≤ Tcross. Finally, we argue that the actual Tc is comparable to Tcross, while at Tcross < T < Tp phase fluctuations destroy superconducting long-range order, and the system displays a pseudogap behavior.