Philippe Coutinho struck the crossbar early on before giving Barca the lead midway through the first half, tapping into an empty net after brilliant link play between Messi and new signing Francisco Trincao.
Messi then doubled Barca's advantage later in the half, spinning away from a defender to thump a shot in off the post and score for the first time since threatening to leave the club last month.
Samu Saiz scored for Girona right at the start of the second period but Barca's captain struck again in the 50th minute, also cutting inside to shoot from outside the area but this time benefiting from a heavy deflection.
Koeman made four changes to the lineup that had beaten Gimnastic de Tarragona 3-1 in his first game on Saturday and made nine substitutions midway through the second half, only keeping on defender Ronald Araujo and goalkeeper Neto.
This was a more fluid and exciting display than against Gimnastic, with Messi looking sharper and Portuguese Trincao showing confidence and flair every time he got on the ball.
Teenager Pedri was Barca's liveliest substitute and had three attempts on goal after coming on, forcing Girona keeper Jose Suarez to make two smart saves, while American forward Konrad de la Fuente also impressed.