The 23-year-old has agreed a two-and-a-half-year contract with an option for a further 12 months.
"He's left-footed, which gives us good balance. We've been looking for a left-footer for a while," boss Nathan Jones told the Luton website.
Gambin has six caps, but was suspended for Malta's 2-0 defeat by England at Wembley last October.
He made 23 appearances for Barnet this season, scoring four goals, the last in a 3-1 defeat at Luton on New Year's Eve.
The Hatters are currently sixth in League Two, six points off the automatic promotion places.
Find all the latest football transfers on our dedicated page or visit our Premier League tracker here.

President Nicos Anastasiades said new measures, mostly affecting the Russian business community, would be approved at a cabinet meeting on Monday.
Russians have billions of euros in Cypriot bank deposits.
Investors were angered when it emerged they would lose up to 60% of their savings under the terms of the bailout.
In order to secure the 10bn euros, agreed by the EU and IMF, Cyprus was forced to wind up one major bank and write-off of a large portion of secured debt and uninsured deposits in the largest bank, Bank of Cyprus.
Speaking at a Russian business conference in the coastal resort of Limassol, President Anastasiades said the new measures would "mitigate to some extent the damage" Russian investors had endured.
Cyprus has been a member of the EU since 2004. It sealed an EU bailout last month to save it from bankruptcy.
President Anastasiades said foreign investors who held deposits prior to 15 March, and who lost at least 3m euros would be eligible to apply for Cypriot citizenship.
Cyprus's existing "citizenship by investment" programme will also be revised to reduce the amount of investment required to be eligible from 10m euros to 3m.
The president said he would also drop requirements for citizenship applicants to keep 15m euros in Cypriot banks for five years, saying they would be allowed immediate access to their money.
"These decisions will be deployed in a fast-track manner," President Anastasiades said.
The Cypriot economy is worth about 18bn euros, which accounts for less than 0.2% of the eurozone total.

Network Rail said the railway station would be shut between 30 September and 22 October so passenger capacity can be increased.
It is part of the rail management company and Liverpool City Region's Â£340m project to upgrade 10 railways.
A spokesman for Network Rail said disruption would be "kept to a minimum" and most services would run to and from Liverpool South Parkway instead.
Annual passenger numbers at Lime Street station are forecast to double in peak periods by 2043, said Network Rail, and these improvements will enable it to cater for the increased capacity.
The work will see two new platforms created, existing platforms remodelled, overhead line equipment to power electric trains installed and tracks upgraded.
The six train companies which serve Liverpool have been working on a plan for more than a year to keep customers moving.
Network Rail said bus replacement services would be offered when necessary and passengers would be guided to alternative city centre stations.
The company's spokesman said the renovation was "the biggest upgrade of the station since the 19th Century".
"It will provide passengers with faster, more frequent and reliable train services by 2019," he added.
Liverpool Lime Street was closed for a week for emergency repair work after a wall collapsed on to the tracks on 28 February.
The work is not related to the damage caused by 200 tonnes of debris which fell on tracks in the approach to the station, said Network Rail.
Source Network Rail
Luton Town have signed Malta international winger Luke Gambin from Barnet for an undisclosed fee.
[NEXT_CONCEPT]
Cyprus is to relax its citizenship rules for foreign investors who lost at least 3m euros (£2.5m) under an EU bailout deal.
[NEXT_CONCEPT]
Liverpool Lime Street is to close for three weeks for a major refurbishment.