To differentiate between the contribution of mammary epithelial cells (MEC) and infiltrating immune cells to gene expression profiles of mammary tissue during early stage mastitis, we investigated in goats the in vivo transcriptional response of MEC to an experimental intra mammary infection (IMI) with Staphylococcus aureus, using a non-invasive RNA sampling method from milk fat globules (MFG). Microarrays were used to record gene expression patterns during the first 24 hours post-infection (hpi). This approach was combined with laser capture microdissection of MEC from frozen slides of mammary tissue to analyze some relevant genes at 30 hpi. During the early stages post-inoculation, MEC play an important role in the recruitment and activation of inflammatory cells through the IL-8 signalling pathway and initiate a sharp induction of innate immune genes predominantly associated with the pro-inflammatory response. At 30 hpi, MEC express genes encoding different acute phase proteins, including SAA3, SERPINA1 and PTX3 and factors, such as S100A12, that contribute directly to fighting the infection. No significant change in the expression of genes encoding caseins was observed until 24 hpi, thus validating our experimental model to study early stages of infection before the occurrence of tissue damage, since the milk synthesis function is still operative. This is to our knowledge the first report showing in vivo, in goats, how MEC orchestrate the innate immune response to an IMI challenge with S. aureus. Moreover, the non-invasive sampling method of mammary representative RNA from MFG provides a valuable tool to easily follow the dynamics of gene expression in MEC to search for sensitive biomarkers in milk for early detection of mastitis and therefore, to successfully improve the treatment and thus animal welfare.