Yes, you definitely have to "pay your dues" to be a major airline pilot. The payoff is senior, narrow-body Captains can possibly gross $350,000 - $400,000 right now with some overtime and profit sharing. That number includes the 401k match.
Even senior First Officers can gross $250,000+ if they work a lot - or know how to "work the system" well.