The Justice Department’s investigation into Wall Street’s rigging of the $14 trillion Treasury market is zeroing in on Goldman Sachs — just as the bank’s former employees have taken over the agency that’s at the center of the probe, The Post has learned.

Goldman Sachs won almost all auctions for US Treasury bonds from 2007 to about 2011, a remarkable winning streak that came despite safeguards established by the Treasury to keep bidding competitive, sources familiar with the investigation said.

At the center of the case are chats and emails believed to show Goldman traders sharing sensitive price information with traders at other banks — a sign of possible price fixing and collusion, according to sources familiar with the investigation.

“They didn’t lose many bids,” one person who has seen the bid data told The Post. The prices Goldman offered for Treasury bonds “would be very close” but just above offers from other banks, and typically arrived “at the end of the auction.”

Spokespeople for Goldman and the Justice Department declined to comment. A message left for the Treasury’s press office wasn’t returned.

The probe’s details are becoming clearer at a time when at least half a dozen Goldman Sachs alumni are in high levels of the executive branch. The Treasury is run by former Goldman Sachs partner Steve Mnuchin. Gary Cohn, who is now director of the president’s National Economic Council, was president of Goldman Sachs during the years when the rigging is believed to have occurred.

At least four other banks are being investigated for colluding with Goldman traders: Deutsche Bank, Royal Bank of Scotland, UBS, and BNP Paribas, a source said.

No one has accused any bank, or Mnuchin or Cohn, of any wrongdoing.

The investigation is focusing on Goldman’s interactions with the bedrock of the US financial system: the Treasury’s auctions for debt in the form of bonds and notes.

Those bonds, which are sold in about 300 auctions a year, not only finance the government’s operations, but also help set rates for everything from home mortgages to credit cards.

Goldman is one of 23 primary dealers that bid directly with the government and then distribute Treasury bonds to their clients. In the auctions, those primary dealers submit secret ballots before 11 a.m. for as much as 35 percent of the share of the offering. The bank with the highest bid wins.

Specifics of the auction bids are a closely held secret. Last year, Treasury denied The Post’s Freedom of Information Act request for data going back to 2000 on the grounds that it was “protected from disclosure as confidential commercial or financial information.”

Treasury did release partially redacted data on auction bids that had been changed — a potential sign of manipulation — but the documents don’t identify the bidder or the price paid.

Officials at Treasury were aware of Goldman’s disproportionate winning streak at the time — but they assumed that the bank was just better at pricing the bonds, one person who’s familiar with the bid data told The Post.

Treasury officials, however, were aware that other major investors, including some central banks, had concerns that banks were front-running their own customers in order to make more money off them.

“There had been some nervousness on the part of large buyers,” the person said. “They were worried about being front-run sometimes.”

That concern contributed to a surge in direct bidders — investors who bypass the bank and try to get a chunk of the bonds through the auction process — around 2010, the source said.

At the time, big investors wanted “to put their money to work in the government-bond market without revealing their intentions to the primary dealers,” noted a January 2010 Wall Street Journal article about the rise in direct bidders.

“When you see a surge in direct bidders, you have to ask what it means,” the person said.

The investigation has spurred a class-action lawsuit in Manhattan federal court led by a Cleveland pension fund against the 22 primary dealer banks.

After The Post first broke news of the investigation in June 2015, primary dealers changed how they bid on auctions, according to the suit.

At the time that the rigging is believed to have happened, Cohn was the No. 2 person at Goldman, behind CEO Lloyd Blankfein. In Cohn’s position as president and co-chief operating officer — a position he later ran by himself — he oversaw the unit of the bank that submitted the bids to Treasury.

The DOJ, which started the investigation in June 2015, is still in the middle stages of its probe, sources said.

While the Justice Department conducts all of its investigations in secret, people familiar with the probe told The Post that the DOJ is more tight-lipped than usual in this case.

Last month, when the DOJ sent subpoenas to RBS, UBS, and BNP Paribas, for instance, some investigators conducting parallel probes at other agencies found out about it through press reports, one source said. Some agencies had already obtained the messages sought by the DOJ earlier, the person said.

BNP Paribas, Deutsche, RBS and UBS have previously declined to comment on the investigations.

Officials at the Treasury under the former secretary, Jacob Lew, found the investigation highly embarrassing, and pressed for a quick resolution of the probe.

DOJ investigators are aware of the sensitivity of the investigation, another source told The Post.

At least four other agencies — the Securities and Exchange Commission, the Commodity Futures Trading Commission, and the New York Department of Financial Services, as well as the European Commission — are looking into the alleged rigging.