Luis Suarez earlier put Barca in front by finishing a fine team move before tucking in his side's third in the second half.
After seeing their advantage cut to two points by Atletico Madrid earlier on Sunday, Barca restored their five-point cushion easily on Messi's historic night.
Having received the ball from Suarez, the five-time Ballon D'Or victor made himself some space before firing low under Asier Riesgo.
Messi, 31, has scored eight goals in his past five league games, including a double against Espanyol and a hat trick against Levante.
Suarez opened and concluded the scoring for Barcelona at Camp Nou.
Coutinho also played a role in Messi's goal in the 53rd, passing the ball to Suarez, who then found Messi, who cut around a defender and fired in a low, left-footed strike.
Griezmann ensured that Atletico stayed in touch with Barcelona.
Griezmann has now scored all of Atletico's last six goals and this latest one proved the difference in a cagey contest at the Wanda Metropolitano.
However, that doesn't mean that the five-time Ballon d'Or victor has not had his low points for both club and country.
Cadena Cope says after finding himself sidelined by Valverde, Coutinho has had his agents go to the board for reasons why he is out of the team.
The pressure has been on Real Madrid all season but they battled to a 2-1 win over Betis for their first league victory of 2019.
Sevilla had won 3-1 at Bilbao's San Mames Stadium in the Copa del Rey on Thursday.
Barcelona manager Ernesto Valderde praised Messi's performance after the match, saying he had "the feeling that [Messi] will" reach the 500-goal mark. They will meet again on Wednesday in Seville in the return leg of their round-of-16 game.