Denis Hennessy, 41, who was sentenced to life imprisonment and was out on license following the murder of a homeless man in 1992, Westminster Magistrates' Court was told.
In the UK, prisoners sentenced to more than 12 months in prison can be released early on license, which means they are still serving a prison sentence but can live in the community
Hennessy cut his right hand climbing over the perimeter wall of Queen's London home on Wednesday evening before being arrested by Scotland Yard officers.
Prosecutor Tom Nicholson told the court that after being detained, he repeatedly asked "is Ma'am in?", in reference to the Queen.
Also Read
Hennessy told police during interview that he had "walked through the gardens admiring the view".
Chief magistrate Howard Riddle sentenced Hennessy to four months for trespassing and two months, to run concurrently, for damaging the wires of the alarm system.
The Queen was in residence at the time of the intrusion, with husband Duke of Edinburgh and younger son Prince Andrew, the Duke of York.
"I am content that our security measures worked effectively on this occasion and at no time was any individual at risk," Commander Adrian Usher, head of the Met's royalty and specialist protection, had said after the incident.
There have been a number of security breaches at Buckingham Palace in the past, with the most famous one being that of Michael Fagan, who got into the Queen's bedroom in 1982 and spent 10 minutes talking to her before she managed to raise the alarm when he asked for a cigarette.