in any viewport, change your view to the camera you want to render from. then, under view (in the viewport), choose camera attribute editor. scroll down to the environment tab and expand it, then click the black swatch next to background color to pick your new color, or just move the slider if you want a gray.