Quantum-critical pairing in electron-doped cuprates