[deleted]
Its actually very simple, they used Japanese charts!
It was communicated through advance parties that the fleet would require charts, military and civilian pilots familiar with Sagami and Tokyo Bay, and that the minefields laid there should be cleared sufficiently to let the fleet anchor and operate, and that the naval base at Yokosuka would be occupied by shore parties.
On August 27th the flagship group of Halsey's 3rd Fleet including Missouri, and Admiral Nimitz who had flown out from Guam and was aboard the South Dakota and the US battleship Iowa and British Duke of York and King George V among others along with a gaggle of escorting destroyers met the lone Japanese destroyer Hatsuzakura which was ordered to carry the 20 or so pilots, naval officers, and interpreters to a meeting aboard Missouri. She was ordered to steam with guns depressed and breaches open, and to minimize the number of mean topisde. After meeting with the destroyer Nicholas, a veteran Fletcher class which had first seen action in late 1942 off Guadalcanal who along with her sisters had specifically been asked for by Halsey to serve as escorts for the surrender, the Japanese personnel were transferred to Missouri and several other ships as the US and British destroyers would essentially go first and the battleships conform to their movements and follow in their wake.
We even have pictures of the party boarding the Mo and meeting with US and Allied officials. While they had all the charts to allow the fleet to anchor in Sagami Bay, and for a smaller contingent to advance up into Tokyo Bay for the surrender and base seizure, not all was ready. Minesweeping was going slower than planned and while they had maps of the safe channels through, not everything could be guaranteed as the USN well knew.
Boarding the flagship, charts in hand.
Meeting with Allied officials.
After anchoring for the night a detachment of Minesweepers first checked the channel up to Tokyo, followed by a detachment of destroyers and the cruiser San Diego to secure the IJN Naval Base with Marines and Sailors, while additional ships also provided manpower to begin sorting and checking out the POW camps. And on the 29th the big boys stood out and with a few minesweepers again checking the way then came the other small boys, and final the Iowa and Missouri. The fleet also knew exactly where they wanted to be, the Missouri and her consorts were to anchor as close to the place where Commodore Perry had placed his ships in 1853.
Anchoring in the shadow of Mt Fuji the evening of the 27th The view the next morning with American and British battleships in view.
It could be tense as this remembrance from the Nicholas's navigator LTJG Turpen mentions:
I was busy! Captain Lyndon asked me if I could navigate the channel. A chart in any language is still a chart, so I said "yes." Then he ordered the pilot up against the bulkhead under armed guard. But I still had four turns in the minefield to get through and a battleship conforming to my movements with the admiral on board, and all the while we were wondering if someone wouldn't try to sink her right there in the entrance to the bay.
Missouri with Iowa astern making their way up the channel into Tokyo Bay
In the end though everything was successful without any violence or accidents. Nicholas would spend 2 more days off Tokyo with the flagship, and would both ferry Nimitz and Halsey ashore to Yokosuka to meet MacArthur. And on the morning of the 2nd she along with her squadron mates Buchannon, Landsdowne, and Taylor ferried the Allied dignitaries including MacArthur, press contingents, and the Japanese delegation to the Missouri.
For more in an easy read I would check out this article from the USNI Naval History Magazine: https://www.usni.org/magazines/navalhistory/2006-02/destroyers-tokyo-bay