Luis Rioja struck for Alaves early in the second half, but Trincao added his second and within a minute Messi curled home Barca's fourth.
Junior Firpo completed the scoring with 10 minutes remaining as Barca extended their unbeaten league run to 12 matches and climbed up to second in the table, eight points behind leaders Atletico Madrid.
Barca's teenage midfielder Ilaix Moriba, also making his LaLiga debut, had an early header blocked before the home side went on to dominate the first half.
During the first 25 minutes Barca had over 80 per cent possession but failed to carve out any clear-cut chances.
Barca responded by taking a 29th-minute lead. Moriba collected a cross inside the penalty area and unselfishly set up Trincao, who lashed the ball home through the legs of a defender on the goal line.
Messi thought he had made it 2-0 when firing home a rebound after Antoine Griezmann's shot had been saved, but the Frenchman had been offside.
But Barca skipper Messi was not to be denied in first-half stoppage time when he turned neatly away from his markers and fired a low 25-yard effort in off the inside of a post.
The Argentinian has scored in each of Barca's last five matches.
Lucas Perez blazed a half-chance over for Alaves from a tight angle early in the second half but the visitors pulled one back through substitute Rioja, who applied an ice-cool finish in the 57th minute.
Barca regained their two-goal lead 17 minutes later when Trincao followed up after Messi's initial shot had been saved goalkeeper Fernando Pacheco.
Within a minute Messi curled home a superb effort from 25 yards to make it 4-1 and he was central to Barca's fifth in the 80th minute, dinking the ball over the top to Griezmann, who teed up Firpo for an emphatic finish.
Trincao was denied a hat-trick by the offside flag in the closing stages as Barca chased a sixth goal.