The question is stated quite simply, but since I have heard this often, and very little of discussion on it. I chose to do some proper research. The answer I would be writing would be discussing more than just the question, it would be discussing the stated verse in the question as well.
Sāvitrī mantra, also known as Gāyatrī mantra because of it being composed in Gāyatrī chanda (poetic meter). It appears first in the R̥g Veda (3.62. 4-18), composed by Viśvāmitra Gāthina in the Gayatrī chanda, dedicated to a solar deity Sāvitṛ, one of the Ādityas.
Br̥hadāraṇyakopaniṣad (5.14) has a full chapter dedicated to GāyatrĪ or Sāvitrī mantra (both being used interchangeably). Its glorious mention and praise is present in Śatapatha Brāhmaṇa (e.g. 14.8.15.7), Maitrī Upaniṣad (6.2), Manusmr̥ti (2.77 ; 2.81 ; 2.83) and so on likewise in other dharmasūtras, dharmaśāstras, Purāṇas and later texts. This clearly shows the importance of Sāvitrī mantra in Vedic tradition.
In MN 92 (Sela Sutta), which is raised in the question, Buddha says:
“Aggihuttamukhā yaññā,
sāvittī chandaso mukhaṁ;
Rājā mukhaṁ manussānaṁ,
nadīnaṁ sāgaro mukhaṁ.
The fire-oblation (agnihotra) is the foremost of sacrifices;
The Sāvitrī is the foremost of poetic meters (chandas);
A king is the foremost of humans;
The ocean is the foremost of rivers.
Nakkhattānaṁ mukhaṁ cando,
ādicco tapataṁ mukhaṁ;
Puññaṁ ākaṅkhamānānaṁ,
saṅgho ve yajataṁ mukhan”ti."
The moon is the foremost of stars (nakṣatras);
The sun the foremost of fires;
But for those who sacrifice seeking merit,
An offering to the Saṅgha is foremost.
The verses quoted above are given by the Buddha in appreciation of Keṇiya's humble offering. The poem thus serves as a form of blessing after the Buddha and the bhikkhus have been fed. Keṇiya was his host and although he respected Buddha, he still held faith in Brāhmaṇas, seeing no contradiction in maintaining his traditional Brahmanical practices. In this aspect, he was different to brāhmaṇa Sela, who is although a revered one in tradition and in whom Keṇiya held faith, he still came to believe Buddha's practice to be superior to Brahmanical. Keṇiya remains a householder, offering alms and not joining the saṅgha, while Sela goes forth to become an arahant, this shows the contrast b/w the two of them. It's important to note that although in these verses Buddha praises Sāvitrī mantra, agnihotra, sun and moon but at the end, he clearly stated that offerings to the Saṅgha are better than any of the merit-seeking sacrifices prescribed in the Vedas, which is not the Vedic view but his own.
It is interesting to note the comparitive analysis of this verse from MN 92 with Taittirīya Saṁhitā which claim that a certain meter (5.2.1.5) or sacrifice (7.1.1.3) is best/highest. The Pāl̥i verse seems to provide an alternative to the view expressed in (5.4.12.1), which holds that trirātra (three-nighter) to be the best of sacrifices (paramas triātro yajñānām) and anuṣṭubh to be the best of meters (paramā vā eṣā chandasāṁ). Note, that a few versions of Sāvitrī mantra such as that in Chāndogyopaniṣad (5.2.7) are in anuṣṭubh chanda rather than the Gāyatrī chanda used in R̥g Veda (3.62. 4-18), this issue was raised even in Br̥hadāraṇyakopaniṣad (5.14.5) which says that although some recite Sāvitrī as an anuṣṭubh but it's wrong, and one should recite it instead as a gāyatrī. But there are many passages which glorify the usage of anuṣṭubh chanda such as Aitareya Brāhmaṇa (3.15.1), Jaiminīya Brāhmaṇa (1.272.13) and Śatapatha Brāhmaṇa (3.1.4.16). So, it's quite a controversy.
Sela Sutta (MN 92) has some parallels such as Bhesajjakkhandhaka (Kd 6) and a few others which can be found in the suttacentral link of MN92 in the references at the end of answer. A similar verse occurs in Sanskrit in Mahāvastu 108 (Mv 108):
“agnihotramukhā yajñā Sāvitrī chandasāṃ mukhaṃ ǀ
rājā mukhaṃ manuṣyāṇāṃ nadīnāṃ sāgaro mukho ǀǀ
nakṣatrāṇāṃ candro mukhaṃ ādityo tapasāṃ ǀ
ūrddhaṃ tiryag adhastâpi yāvatā jagatāṃ gati ǀ
sadevakasya lokasya sambuddho vadatām varo" ||
Translation: “The fire-sacrifice (agnihotra) is the foremost sacrifice; the Sāvitrī is the foremost among chandas; a king is the foremost among men; the ocean is the foremost of rivers. The moon is the foremost of stars (nakṣatras); the sun is the foremost of fires; above, across and below, as far as the sphere of living beings. The perfectly enlightened Buddha is the foremost among speakers in the world of men and (in the world) of devas.”
In Mv 108, the story is different to MN 92. In Mv 108, Buddha meets three Kāśyapas, who were Jaṭilas (matted hair ascetics), who eventually followed him and instead of Keṇiya, Uruvilvā-Kāśyapa serves his a meal, for which Buddha said the verses before in appreciation. In Mv 108, Buddha doesn't state the last two lines of aforementioned verse in MN 92 (puññam ākaṅkhamānānaṁ, saṅgho ve yajataṁ mukhan"ti.) which shows offering to saṅgha superior to all sacrifices in Vedic tradition, and instead has different line praising Buddha as the foremost among men and devas.
The verses of Buddha in MN 92 and Mv 108 are pretty similar to a poem which appears in some versions of Mahābhārata. There the poem begins with the words agnihotramukhā vedā gāyatrī chandasāṁ mukham. However, according to Bodewitz (2003, p. 5), the latter might possibly be a 'wrong version' of the Pāl̥i verse. The translation of this full poem is presented by Ganguli:
As the agnihotra is the foremost among all Vedic sacrifices,
as the Gāyatrī is the foremost among chandas,
as the king is the foremost among men,
as the ocean is the foremost among all rivers,
as the moon is the foremost among all constellations,
as the sun is the foremost among all luminous bodies,
as the Meru is the foremost among all mountains,
as Garuḍa is the foremost among all birds,
so as long as the upward, downward, and sideway course of the universe lasts,
Keśava is the foremost in all the worlds including the regions of the celestials.
(Section XXXVII, Rājasūyika Parva, Book 2: Sabhā Parva)
Smith (2001) explains the lines of the poem to be 'short fragments of text attested in one or more manuscripts but not accepted into the constituted text of the Critical edition'. Basically, this poem is not present in the Critical edition of Mahābhārata by BORI.
The first six lines of the verse are closely similar to that present in Mv 108 and MN 92, the later lines of the three verses however differs. While Buddha's poem in MN 92 ends as a sort of paean to saṅgha, the Mahābharata version ends as a paean to Keśava (another name of Kr̥ṣṇa). Both versions are speculated to have derived from forms of praise occuring in earlier Brahmanical oral texts. It's possible that Mv 108 was derived from MN 92. And it is possibly that either Mahābhārata version was derived from Mv 108, because the Mahābhārata version is closer in structure to Mv 108, or the other way round, where Mv 108 might have been derived from Mahābhārata verse.
In Fobenxingji jing (佛本行集經), T. 3, no. 190, translated by Jñānagupta 闍那崛多 in 591 C.E., there is a verse which is similar to Mv 108 in content
祭祀火為最,諸偈歎為最;
人中王為最,諸流海為最;
星宿月為最,諸明日為最;
上下及四方,及於眾生輩,
若天若人者,諸佛是為最。
Among sacrifices, fire (-sacrifice) is the best. Among verses, eulogy (歎) is the best. Among men, a king is the best. Among streams, the ocean is the best. Among stars, the moon is the best. Among lights, the sun is the best. Above, below and in four directions (of the world), and among sentient beings, whether among gods or among human beings, buddhas are the best”
Here, as we clearly see, although it is similar to Mv 108, Sāvitrī mantra isn't mentioned and instead 歎 is used and even the meaning of sacrificial fire is not the same as agnihotra in Vedic tradition . This is more of a case where the translation resulted in the slight change of content, due to cultural difference.
References & Further Reading
- Ānandāśrama Sanskrit Series (ĀaSS) 42. (1949). Taittirīya Saṁhitā, Part 7. . (K. S. Agase, Ed.) Anantanarayana, H. S., Lehmann, W., Gardner, J., Fushimi, M., Ahlborn, M., & Gippert, J. (Eds.). Śatapatha-Brāhmaṇa Mādhyandina-Recension. TITUS Texts: http://titus.uni-frankfurt.de/texte/etcs/ind/aind/ved/yvw/sbm/sbm.htm
- Bodewitz, H. W. (2003). Thee Daily Evening and Morning Offering (Agnihotra) According to the Brāhmaṇas. Motilal Banarsidass
- Brereton, J. P., & Jamison, S. W. (2014). The Rigveda : The Earliest Religious Poetry of India. Oxford University Press.
- Eggeling, J. (1885). The Śatapatha-Brāhmaṇa: According to the Text of the Mādhyandina School, Part II: Books III and IV (Sacred Books of the East, Vol. 26). Clarendon Press.
- Eggeling, J. (1894). The Śatapatha-Brāhmaṇa: According to the Text of the Mādhyandina School, Part III: Books V, VI and VII (Sacred Books of the East, Vol. 41). Clarendon Press.
- Eggeling, J. (1897). The Śatapatha-Brāhmaṇa: According to the Text of the Mādhyandina School, Part IV: Books VIII, IX and X (Sacred Books of the East, Vol. 43). Clarendon Press.
- Eggeling, J. (1900). The Śatapatha-Brāhmaṇa: According to the Text of the Mādhyandina School, Part V: Books X1, XII, XIII and XIV (Sacred Books of the East, Vol. 26). Clarendon Press.
- Fobenxingji jing (佛本行集經), T. 3, no. 190: https://cbetaonline.dila.edu.tw/zh/T0190_055
- Fushimi, M., & Gippert, J. (eds.). Taittirīya-Samhitā. TITUS Texts: http://titus.uni-frankfurt.de/texte/etcs/ind/aind/ved/yvs/ts/ts.htm
- Ganguli, K. M. (Trans.). (1883-1896). The Mahābhārata of Krishna-Dwaipayana Vyasa. from Book 2: Sabhā Parva: Section XXXVII: https://www.sacred-texts.com/hin/m02/m02037.htm
- Keith, A. B. (1914). The Veda of the Black Yajus School, Entitled Taittiriya Sanhita, Part 1: Kandas I-III (Harvard Oriental Series, Vol. 18). Harvard University Press.
- Keith, A. B. (1914). The Veda of the Black Yajus School, Entitled Taittiriya Sanhita, Part 2: Kandas IV-VII (Harvard Oriental Series, Vol. 19). Harvard University Press
- Keith, A. B. (1920). Rigveda Brahmanas: The Aitareya and Kauṣītaki Brāhmaṇas of the Rigveda (Harvard Oriental Series, Vol. 25). Harvard University Press.
- Manu, Medhātithi, Jha, G. (1920-1926). Manusmr̥ti with the Manubhāṣya of Medhātithi. University of Calcutta. Online version: https://www.wisdomlib.org/hinduism/book/manusmriti-with-the-commentary-of-medhatithi
- Marciniak, K. (Ed.). (2019). The Mahāvastu: A New Edition (Vol. 3). Bibliotheca Philologica et Philosophica Buddhica XIV,1. International Research University for Advanced Buddhology. Soka University. https://www.academia.edu/59232487/The_Mah%C4%81vastu_A_New_Edition_Vol_III
- Oertel, H. (1896). “The Jāiminīya or Talavakāra Upaniṣad Brāhmaṇa: Text, Translation and Notes.” Journal of the American Oriental Society, Vol. 16, pp. 79-260
- Radhakrishnan, S. (Ed.) (1968). Maitri Upaniṣad. In The Principal Upaniṣads (S. Radhakrishnan, Trans., pp. 793-859). George Allen & Unwin https://archive.org/details/PrincipalUpanishads/page/n795/mode/2up?view=theater
- Śaṅkarācārya, & Mādhavānanda. (1950). The Br̥hadāraṇyaka Upaniṣad- with the commentary of Śaṅkarācārya. (Mādhavānanda, Trans., 3rd ed.). Advaita Ashrama. https://www.wisdomlib.org/hinduism/book/the-brihadaranyaka-upanishad
- Sela Sutta MN 92 (its translations and parallels): https://suttacentral.net/mn92?view=normal
- Shults, B. (2014). On the Buddha’s Use of Some Brahmanical Motifs in Pali Texts. Journal of the Oxford Centre for Buddhist Studies, 6. http://jocbs.org/index.php/jocbs/article/view/76/96
- Smith, J. D. (2001). Electronic Text of the Mahābhārata: Supplementary Passages (General Information and Sabhāparvan). Bhandarkar Oriental Research Institute. https://bombay.indology.info/mahabharata/apps.html