The payments were due to be made to Barr and Maxi Construction, but the conman fooled council staff into paying the cash into bogus accounts.
Fraudster Mangal Singh Dhami netted £102,846 from South Lanarkshire and £270,828 from North Ayrshire in the swindle, which he ran in June 2010.
The fraud echoed a similar but unconnected scam played on Olympic Delivery Authority staff where a gang posed as Skanska to redirect a £2.3m payment into a bogus bank account.
Dhami phoned a temporary clerical assistant at South Lanarkshire Council claiming that he was from contrator Maxi Construction.
He said he was checking how much the council owed the firm and said its bank details had changed.
A clerk told him to confirm the changes by email, which was sent within hours. It was accepted by council bosses and the payment cleared.
The fraudster then pulled off the same swindle at North Ayrshire, this time saying he worked for Barr Construction.
He was sentenced to three years in jail by Sheriff Vincent Smith, who said: “This was a significant amount of money, and it must be met with a significant sentence.”