Former Spain keeper Casillas is in a stable condition following a heart attack during training with Porto on Wednesday.
The 37-year-old – Spain's record appearance maker with 167 caps – was hospitalised but the Portuguese giants confirmed his "heart problem resolved".
Contentos con el resultado de esta noche. Pero aún nos queda ir a Anfield, una cancha muy difícil, donde el Liverpool que es un equipazo apretará mucho. Viene el momento más importante de la temporada y hay que estar más juntos y unidos que nunca. Por último, quiero aprovechar para mandarle un abrazo a @ikercasillas y desearle que se recupere muy pronto.
"Happy with the result of tonight," Messi wrote via Instagram post-match. "But we still have to go to Anfield, a very difficult stadium, where Liverpool – who are a great team – will push hard.
"The most important moment of the season is coming and we have to be closer and united than ever.
"Finally I want to take this opportunity to send a hug to Casillas and wish him to recover very soon."
Casillas won five La Liga titles and three Champions Leagues during 16 decorated seasons with Real Madrid, while he was Spain's last line of defence during their golden period – winning Euro 2008 and Euro 2012 either side of the 2010 World Cup.
He joined Porto in 2015 and helped them win the Primeira Liga in the 2017-18 campaign.
This season, Casillas has made 31 league appearances and 42 in all competitions for Porto – who lost to Liverpool in the Champions League quarter-finals.