MSN all registered in the first period of the contest, before Messi added his second from the penalty spot early in the second half and Rafinha hit a long-range stunner as the visitors, who conceded late on from a Gabriel free kick, moved into first spot in the table above Real Madrid.
Inside the atmospheric stadium, which holds little under 11,000, it was the home side that made the brighter start to proceedings as Darwin Machis raised the crowd with his pace and trickery in wide areas of the field.
When the teamsheets were announced, it had been thought that Barcelona would take to the field with a back three, but it was Javier Mascherano, somewhat surprisingly, that operated in the right-back position for the Spanish champions.
Leganes continued to impress inside the opening 10 minutes and threatened to make the breakthrough when Ivan Rakitic had his pocket picked in a dangerous position, but Machis's powerful strike was blocked by Gerard Pique.
Machis, who was full of energy and running in the early exchanges, then turned provider in the 14th minute as he set up Carl Medjani with a cross from the right, but the Algerian's header was high of the crossbar.
Leganes continued to commit players forward on home soil, but it was Barcelona that made the breakthrough in the 15th minute when Suarez raced clear down the right before setting up Messi, who could not miss from close range.
Barcelona had a super chance to score a second in the 20th minute when Suarez delivered another telling cross from a wide area, but Neymar could only volley over the crossbar as Leganes's five-man defence continued to look vulnerable.
Leganes almost scored a spectacular own goal in the 24th minute when Medjani, in challenging Suarez, sent the ball towards the top corner, but Jon Ander Serantes saved to spare his teammate's blushes.
Barcelona did score their second in the 31st minute, however, when Messi took advantage of a poor pass outside the Leganes box before driving into the area and finding Suarez, who simply tapped the ball into the empty net.
The home side continued to threaten though and had a chance to halve the deficit 10 minutes before the break when Machis drove into the box, but the number seven's first effort was kept out by Marc-Andre ter Stegen, before Samuel Umtiti produced a goal-line clearance.
It got worse for Leganes in the penultimate minute of the first period, however, as Messi delivered a through-pass into the path of Suarez, who slid the ball into Neymar and it was 3-0 as the MSN all registered in the first 45 minutes.
The first chance of the second period fell to the home side as Mamadou Kone burst through a couple of Barcelona challenges before striking towards goal, but it was a routine save for Ter Stegen, who dropped down low to make the stop.
Barcelona had their fourth in the 55th minute, however, when Unai Bustinza blatantly pulled Neymar to the ground inside the penalty box and Messi stepped forward to find the top corner with a powerful strike.
Messi came close to completing his hat-trick just before the hour when the Argentine sent a low strike towards the bottom corner, but Pablo Insua was on hand to clear off the line after his goalkeeper had been beaten.
Barcelona had the ball in the back of the net for a fifth time in the 63rd minute when Alcacer tapped home from close range after Serantes had pushed a Messi effort onto the post, but the offside flag denied the Spaniard his first goal for the Catalan club.
The visitors were not to be denied moments later, however, as Rafinha sent a long-range effort into the top corner to make it 5-0 with little over 25 minutes of football still to play in the outskirts of Madrid.
Leganes were still carrying a threat though, and Alexander Szymanowski had a shooting chance in the 71st minute after breaking clear of the Barcelona defence, but the second-half substitute fired into the stands.
Neymar provided another low cross in to Alcacer as Barcelona looked for a sixth 15 minutes from time, but Bustinza came from nowhere to make a fine challenge.
Leganes had their goal in the 80th minute, however, when Gabriel found the back of the net with a free kick as the Brazilian became the first player in the club's history to score against Barcelona.
Barcelona will look to make it back-to-back league victories when they welcome Atletico Madrid to Camp Nou on Wednesday night, while Leganes play their next league fixture away to Deportivo La Coruna on Thursday.