The incident happened on Wednesday at about 18:00 in Wardieburn Place West.
The men, aged 43 and 45, had travelled from Aberdeen. They were attacked in a stairwell by two men who are then thought to have left by the back of the block.
Both victims suffered serious injuries and the 43-year-old man is in a critical condition.
Police are appealing for witnesses.
The first attacker is white and aged 17-19.  He has a Central Scotland accent and light-coloured short hair, which is shaved at the sides.
He was wearing a light-coloured sky blue hooded sweatshirt and grey jogging bottoms.
The second attacker is a white man in his mid-20s. He has a stocky build and was wearing a striped top.
Det Ch Insp Stuart Houston, of Police Scotland, said: "This was an appalling attack on two men who came to the address in good faith.
"This attack happened in daylight and we believe there may be a number of witnesses who may have seen the suspects in the area.
"Anyone with information that can help with our inquiries is urged to contact police immediately."
An investigation has been launched into the attempted murder of two men who had travelled to Edinburgh to buy a car.