Assuming you want to keep your net paycheque the same as before your raise, you will need to increase your 401k contribution by more than 8%. This is because the contribution is always less than your full salary, but your wage increase was based on your salary.
For example:
You earn $80,000 a year. +8% wage bump gets you to $86,400 - a wage bump of $6,400. Your 401k contribution at 27% was $21,600. Add 8% gets you to $23,328 - a bump of just $1,728. As a result, your paycheque would be much higher.
You don't get taxed on 401k/Traditional IRA/HSA contributions, so taxes are not an issue here. To get a close number for your new 401k contribution, just add the expected wage bump to your existing 401k contributions, then divide by your original 401k and deduct 1. That's roughly how much you can increase the percentage.
(Wage Increase + Existing 401k contribution)/Existing 401k contribution - 1 = Percentage point increase of 401k.
($6,400 + $21,600)/$21,600 = 1.296 - 1 = 0.296. You can increase your 401k contribution by 29% of your current contribution in this case and your net paycheque will be the same.