Grade 8 can be safely torqued to a higher level than grade 5 without distorting. If substituting a grade 8 for a grade 5, I would maintain the same torque. If the product manufacturer specifies a grade 8, I would not substitute it with a grade 5 bolt.
Likewise, i wouldn't substitute a stainless fastener for a grade 8. It is often misconceived that stainless steel fasteners are strong because they tend to be difficult to drill. This is not true. Depending on the grade of stainless, they can be very prone to distortion.
I have seen tests where, depending on the quality of the fastener, after the first use a grade 5 bolt can lose upwards of 40% of their torquing capacity, ie. your torque wrench shows 40psi but you are actually only getting 24psi of torque. Grade 8's don't lose as much capacity with each use, though imports tend to not hold torque as well. Imports can often be identified by an excessive oil coating to help curb corrosion.