I am no expert at this, but I guess github uses its own CSS, and ultimately renders html. So I guess there has to be some kind of export involved.
I know about two easy options, of which I would recommend grip-mode (requires the python grip package). The other option gfm-mode (appears to rely on deprecated packages Docter or Marked 2).
Looking back at this ...
I've tested your code and when I add quotation marks to the line numbers (as described in the documentation), it works.
Here is the working code:
#+TITLE: Some File
#+include: "another-file.tex" export latex :lines "3-5"
Hope this helps.