The former One Direction star and the DJ have reunited on the new track, which is released on April 8, and follows 2016's 'Next to Me'.
And they are asking people to join in by posting videos of themselves singing the song using the hashtag #AlessoMidnight.
They will then feature the lucky winner of their contest to feature on the track and get to sing along with the 'Strip That Down' star.
Liam tweeted: ''I've got a brand new single with
@Alesso out on 8th April called Midnight!
''We wanted to get our fans involved somehow, so we've come up with the idea of getting one of you to join us on the official remix of the track!
''Use #AlessoMidnight to get involved! http://Alesso.lnk.to/MidnightPresave (sic)''
The British star is known for coming up with unique ways for his fans to interact with him online.
In December, he teamed up with the app QJAM to offer fans a digital signing experience.
The 'Stack It Up' hitmaker gave music lovers the opportunity to talk ''one-to-one'' with him in a live video chat, and they even received a personally signed digital artwork of his debut solo album, 'LP1'.
Meanwhile, Liam has been doing his bit to help during the coronavirus pandemic.
The 26-year-old pop star donated 360,000 meals to food banks who have been struggling to get supplies during the health crisis.
Liam teamed up with the Trussell Trust to provide meals for those in need in the UK and urged his fans to donate to the cause.
He wrote on Instagram: ''No one should have to worry about where their next meal is coming from: not now, not ever. I am donating to @trusselltrust and if you can help too then please do... Take care, stay at home and look after one another. Link in bio to donate.''
He added in a statement: ''It's not right that anyone in our country is unable to afford food. Food banks do incredible work to help the people most in need of support. As this crisis unfolds, joining forces with the Trussell Trust, I will be supporting over 100 food banks in the Midlands and other UK cities so that they can continue to provide their essential community service for those in crisis, providing more than 360,000 meals over the next three months.
''I'm also donating because of The Trussell Trust's mission to work towards a future where no one needs a food bank. When we're out the other side of this, we need to look at why there are people in our country who don't have enough money for food. Long term, I want to play my part in finding a solution to ensure people have enough money to buy their own food - and end the need for food banks.''
Liam's donation supported 100 food banks in Birmingham, Stoke-on-Trent, Coventry, Sheffield, Nottingham and Bristol and others across the UK.
We help you decide who to give your money to.
Nature-inspired songs we just can't get enough of.
Artists are coming up with different ways to entertain and help out this year.
Put these British films about music at the top of your watch list.
The Mifo O5 PROs are some of the most durable wireless earbuds on the market and we can't recommend them enough.
These songs were written for times like these.
Live musicians take a financial hit during the worst health crisis of a generation.
Filmmaker Spurlock (Super Size Me) is known for his investigative wit, but there's none of...
British pop heartthrobs One Direction became a worldwide sensation when they were thrust together on...
Niall Horan, Zayn Malik, Liam Payne, Harry Styles and Louis Tomlinson may make up the...