Andrejs Borodins was in charge of the 1,300 tonne cargo ship Frifjord when a pilot from Dundee harbour found him staggering and incoherent.
The 53-year-old Latvian had planned to sail the 250ft ship from Perth to Norway in July.
Borodins was jailed for four months at Dundee Sheriff Court.
The captain's drunken state was discovered when pilot Barry Nisbet came aboard at Balmerino to help steer the vessel past the road and rail bridges on the Tay.
He sent Borodins to his bunk to sleep off his intoxication, with the first mate taking the wheel as the ship docked in Dundee.
Police attended and arrested Borodins, who failed a breath test. He pleaded guilty on indictment to a charge under the Railways and Transport Safety Act 2003.
Defence solicitor John Kydd said Borodins had been working at sea for 25 years, having previously done his national service in the Russian military.
He said: "It is lucky for him that the pilot did what he did otherwise there could have been a disaster - there could have been an accident.
"He was exhausted from doing back to back six hour shifts and that was his reason for drinking.
"He says he doesn't normally drink much -  this was abnormal for him."
Sheriff Alastair Brown jailed Borodins for four months, reduced from six months for his early guilty plea.
He said: "This charge is not equivalent to drink driving.
"You put yourself in a condition where you were unable to discharge your responsibilities as master of the vessel.
"I regard that as very serious - it is a gross breach of your duty."
A drunken sea captain caught sailing a cargo ship up the River Tay while almost four times the legal alcohol limit has been jailed.