biomaRt is not the best tool for this query; there is no attribute that will directly return the information you want.
One approach would be to retrieve the chromosome, transcript start, transcript end and strand of the ENST ID, then use the chromosomal_region filter to query for genes. For example:
library(biomaRt)
mart.hs <- useMart("ensembl", "hsapiens_gene_ensembl")
enst <- getBM(attributes = c("ensembl_transcript_id", "chromosome_name", "transcript_start", "transcript_end", "strand"), filters = "ensembl_transcript_id", values = "ENST00000520959", mart = mart.hs)
# query for gene IDs 50 kbp upstream
region <- paste(enst$chromosome_name, enst$transcript_start - 50000, enst$transcript_start, enst$strand, sep = ":")
getBM(attributes = "ensembl_gene_id", filters = "chromosomal_region", values = region, mart = mart.hs)
ensembl_gene_id
1 ENSG00000104613
2 ENSG00000175445
In this case ENSG00000175445 is the gene for the ENST and ENSG00000104613 is upstream.
But there are better tools for this purpose; search this site or look at the similar posts on the right of this page, especially Find Nearest Gene Upstream Using Mysql And Perl Program.
That's the style of solution I was leaning to. Good to know I hadn't missed any simple attributes!
Quite an elegant solution even though not designed for the purpose, thanks!