The temporary ruling by US District Judge John Bates in Washington, DC is the first step in a lawsuit against the department by one of the largest US labour unions, which alleges Musk could obtain sensitive information about investigations into his own companies and competitors by accessing government computer systems.
Bates ruled that "although the court harbours concerns about defendants' alleged conduct", the American Federation of Labor and Congress of Industrial Organizations (AFL-CIO) had not shown it was harmed by the Labor Department's actions.
Federation president Liz Shuler said in a statement the decision was "a setback, but not a defeat" and the union would provide more evidence to support its claims.
A Department of Labor spokesperson did not immediately respond to a request for comment sent late on Friday.
President Donald Trump has deputised Musk, the world's richest person and owner of electric vehicle company Tesla, space technology company SpaceX and other companies, to lead the so-called Department of Government Efficiency (DOGE) to identify fraud and waste in the government.
Musk's efforts have alarmed lawmakers and advocacy groups who say he is overstepping his authority by seeking to dismantle agencies responsible for critical government programs and fire federal workers en masse.
Another group of federal employee unions and retirees has separately sued the US Treasury Department to block what it says is the unlawful transmission of sensitive payment records to DOGE personnel.
The Treasury temporarily agreed on Wednesday to not give further access while the case plays out.
In the Labor Department lawsuit, the federation asked the court to block what it said was Musk's imminent plan to access department systems.
The union, which represents roughly 800,000 government workers, said that would potentially give Musk access to non-public information from the Occupational Safety and Health Administration's (OSHA) probes into his SpaceX, Tesla, and his tunnelling company, The Boring Company, as well as investigations into his competitors.
The union also said that in the absence of court intervention, DOGE could access Bureau of Labor Statistics data about the health of the economy and sensitive information about government employees, including the identities of those who have filed worker compensation claims or sought protection for wage and hour complaints.
The White House has said Musk will recuse himself from matters in which he has a conflict of interest.
As a so-called special government employee, he is subject to some but not all conflict-of-interest and ethics rules for federal workers.
Musk's rapid takeover of US government agencies has enabled the South African-born businessman to exert unprecedented control over America's 2.2-million-member federal workforce and begin a dramatic reshaping of government.
Musk has already moved to shut down the US Agency for International Development and says it is cancelling scores of government consulting contracts and under-utilised leases.