NB! It seems this console command is not compatible with CS2.
Command Profile

JOY_INVERTY

CS:GO

This console command is used to set whether you want to invert the Y axis for looking around on a joystick. When this command is turned on, moving the joystick up, or forward, will make your character look down.

Syntax
joy_inverty [0 / 1]

Description

This console command is used to set whether you want to invert the Y axis for looking around on a joystick. When this command is turned on, moving the joystick up, or forward, will make your character look down.

Syntax And Arguments

joy_inverty [0 / 1]
0 / 1 Enter a 1 after this command to invert the Y axis, and enter a 0 to leave it as its default setting (moving the joystick forward/up makes your character look up).